Sunday, August 21, 2011

How to check whether crontab is working for CentOS

To check whether Crontab is working, there are a few pointers you may wish to take note:

1. Check the crond service whether it is working
# service crond status
crond (pid  2873) is running...

Or if you prefer to use ps
# ps -ef | grep cron


2. Check your log file.
# tail -20 /var/log/cron
You should see something like this
........... 
Aug 22 00:41:01 yoursever crond[29827]: (root) CMD ("/root/yourscripts.sh" 2> /usr/local/yourscript_rsync/yourscript_rsync.errors > /dev/null)
..........

No comments: