I've tried eliminating many of the common errors,
ensuring that the PATHs are available for cron
there is an endline at the end of crontab file
the timezone is set-up by:
cd /etc cp /usr/share/zoneinfo/Asia/Singapore /etc/localtime
date in bash, I get:
Tue Sep 17 15:14:30 SGT 2013
In order to check if cron is using the same time,
* * * * * date >> date.txt
is giving the same date output in date.txt.
This is the script I'm trying to execute:
#!/usr/bin/env bash echo data > /root/data.txt
crontab -e, the line below works,
* * * * * /bin/bash /root/event.sh >/tmp/debug.log 2>&1 15 * * * * /bin/bash /root/event.sh >/tmp/debug.log 2>&1
However, when I tried some other arguments, hoping it would run at 2.50pm:
50 14 * * * /bin/bash /root/event.sh >/tmp/debug.log 2>&1
50 14 * * * (cd /root ; ./event.sh >/tmp/debug.log 2>&1)
it will no longer work. Seems like there is a problem with my hour argument. Nothing could be found in the
/tmp/debug.log file either.
It turned out I have to restart the cron service after making changes to TZ.