I've tried eliminating many of the common errors,
1) ensuring that the PATHs are available for cron
2) there is an endline at the end of crontab file
3) 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.