I have been writing housekeeping script , now i need to install housekeeping script as a cronjob on both staging and production environment. i could do it on the staging without a problem and it gives me expected output. when i run it on the production, same script does not turn as a cronjob.following is the cronjob i installed.
#OTB housekeeper scripts
* * * * * /product/susara/tools/housekeeper.sh -t OTB > /tmp/susara.out 2>&1
this is what i did to find out why it is not working on production
- check whether cronjob daemon is running.
when i check it, got the following output and, which says cronjob deamon is running
ps ax|grep cron
output
4120 ? Ss 0:06 crond
13640 pts/6 S+ 0:00 grep cron
- checking the cron job logs
these logs were located in the /log/var
there are log files named cron cron.1 cron.2 etc.
content of these logs does not give my any help to solve the issue. i am difficult to understand what it says.
May 16 08:01:01 pr2vmx08 crond[17471]: (root) CMD (run-parts /etc/cron.hourly)
May 16 08:08:22 pr2vmx08 crontab[17180]: (user1) REPLACE (user1)
May 16 08:08:22 pr2vmx08 crontab[17180]: (user1) END EDIT (user1)
May 16 08:09:01 pr2vmx08 crond[4162]: (user1) RELOAD (cron/user1)
May 16 08:10:01 pr2vmx08 crond[17762]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 16 08:20:01 pr2vmx08 crond[18229]: (root) CMD (/usr/lib64/sa/sa1 1 1)
These two steps did not help me to solve the issue. could anybody having some experince in this area let me know what is going wrong here.
Thanks in advance for any help
There are some things I would check first:
What is the content of file /tmp/susara.out? Is this file being written at all? Use command
tail -f /tmp/susara.out
to see what is being written to this file;
Check permissions for your script, /product/susara/tools/housekeeper.sh under production machine; use command
ls -al /product/susara/tools/housekeeper.sh
Is this script supposed to be running every minute?
Check for possible error messages on file /var/log/messages
Regards