backup script in linux

i have a new linux server where dailybackup is scheduled but it is not running. it is the cold backup scipt for database server. the script is attached here.

the crontab entry is as

[root@aadapps DR]#  crontab -l
00 01 * * * /scripts/ >> /var/log/testcron.log
kurajeshSenior Systems AnalystAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Is /scripts/ executable

ls -l /scripts/
chmod 755 /scripts/
kurajeshSenior Systems AnalystAuthor Commented:
before it was like as folows:
[root@aadapps scripts]# ls -l
total 16
drwxrwxrwx 2 root root 4096 Feb  4 13:26 bkplog
-rwxrwxrwx 1 root root 3309 Mar 13 17:18
-rwxrwxrwx 1 root root  302 Feb  4 11:42
-rwxrwxrwx 1 root root  270 Feb  4 11:42

now i have explicitly given as:

[root@aadapps scripts]# chmod 755

[root@aadapps scripts]# ls -l
total 16
drwxrwxrwx 2 root root 4096 Feb  4 13:26 bkplog
-rwxr-xr-x 1 root root 3309 Mar 13 17:18
-rwxrwxrwx 1 root root  302 Feb  4 11:42
-rwxrwxrwx 1 root root  270 Feb  4 11:42

is that the reason
Does it execute when you invoke the script from the command line?


Have you restarted the CRON services after you made changes to it?

service crond restart
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

First Try to run bash script from root user,

Open in new window

If it works, then crontab also  works.
Make sure that log file exists /var/log/testcron.log
kurajeshSenior Systems AnalystAuthor Commented:
i have not invoked the dailybkp script as it is a production server. i will check as per the schedule.

but i have restarted the crond service

is there anything to check apart from this
kurajeshSenior Systems AnalystAuthor Commented:
the testcron.log file is there

-rwxrwxrwx 1 root  root       0 Feb  5 01:00 testcron.log
I believe you need to update the script with full path for the commands. eg: /bin/rm, /bin/tar etc..
So it means the script executes by taking a look at the time stamp on the log file. You would have to see whats wrong the script. Nothing wrong with CRON.
I'd double check that you are specifying full paths to the commands called from within the script, as torakeshb suggests. That or set cron's PATH explicitly, but better the first option...

You can find out where things live by running 'which <command>' at the command line.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kurajeshSenior Systems AnalystAuthor Commented:
i have manually edited the script and now it is ok , thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.