This weird behaviour from cronjob
Posted
by
The DOCTOR from TARDIS
on Super User
See other posts from Super User
or by The DOCTOR from TARDIS
Published on 2012-10-03T20:29:16Z
Indexed on
2012/10/03
21:43 UTC
Read the original article
Hit count: 267
I have set the crontab
like this:
*/5 0 * * * /www/permitChat.sh
and the /www/permitChat.sh
is this:
# We are setting the name of file
# in the variable along with complete path.
sFilePath=`date +\/www\/ChatLogs\/%Y\/%m/%d_%m_%Y.txt`
# First we set its permissions to
# readable by all users, and then
# modify them to be writable by only root.
chmod a=r $sFilePath
chmod u+w $sFilePath
ls -lh $sFilePath
The trouble I am facing is, the cron gets executed after 12:00 PM everyday, instead of executing at 12:00 AM to 01:00 AM, every 5 minutes.
What could be wrong? All my system variables appear to be synced.
© Super User or respective owner