Problem
I have a script to be run at 1:32 am, so I set a cronjob by
$ crontab -e
And in the editting file, I have
32 1 * * * /home/user/.scripts/midnightjobs
where "user" is my user name. However, it did not work.
Attempts I made
I tried adding a logging function in my script, and hoped to see what was wrong. It seems like the script never has run.
I also tried adding another cronjob at 7:59am:
0 8 * * * /home/user/.scripts/midnightjobs
And it works! The script ran, and did output a log file at 8 am.
My guess
I believe I have been very careful.. and based on my second attempt, my best guess is that my laptop (running on an archlinux) secretly falls asleep at nights, failing to run the cronjob.
cron
's log to see whether it ran the job or not at 01:32?sleep
or some dependency that needs wait for something or check the time itself within itself? is your 1:32AM task last line in your crontab? is there an empty line at the end of your crontab?