Saturday, 15 September 2012

cron - Crontab configuration on CentOS -



cron - Crontab configuration on CentOS -

i have magento installation running on vps runs on centos. i've been trying implement backup solution using script found in here: https://github.com/zertrin. worked fine , next step automate it. despite efforts cron job not running. here have got in /etc/crontab:

* 20 * * * root echo "cron worked $(date)" >> /tmp/cronworked.txt # * 16 * * 1-6 root /root/duplicity-backup.sh -c /etc/duplicity-backup.conf -b # * 4 * * 7 root /root/duplicity-backup.sh -c /etc/duplicity-backup.conf -f # * 20 * * 7 root /root/duplicity-backup.sh -c /etc/duplicity-backup.conf -n # * 20 * * * root echo "cron worked $(date)" >> /tmp/cronworked3.txt

both test cron jobs (first 1 , lastly one), work fine, not commands in middle. work fine if issues them standalone commands reason not cron jobs.

anyone can guide me figure out not working?

there couple of things can check:

make sure /root/duplicity-backup.sh executable

if have local mail service server configured, should receive email output of cron jobs, might tell what's going wrong

if don't receive emails cron job, redirect stdout , stderr file. should help figuring out what's going wrong

add bash in front end of script name create sure it's running bash , not else, somehow, this:

* 4 * * 7 root bash /root/duplicity-backup.sh -c /etc/duplicity-backup.conf -f

having script output , error messages should help. if don't please paste them here.

cron centos crontab

No comments:

Post a Comment