OS type and version
Got one more cronjob question that I cannot wrap my head around. What about 0 hour, is this some special hour?
I got a cronjob with a not too complex script. I make sure it gives some output. Yet it works on:
21:10 hours etc.
But not at: 0:10
It will not run, it will not generate an email because of the output. When I set it to 0:10 and 1:10, it will only run once a day at the latter.
What could be it? I’ve checked the system timezone, seems to be correct.
What else to check or debug? It there something special about 0 hour? On other platforms I could do this without problems, so I’m not aware of any so far.
May 14, 2023, 7:59pm
Cron is something I haven’t done manually in awhile and always had to carefully check syntax. But this is the line from my backup cron.
0,6,12,18 * * * /etc/webmin/backup-config/backup.pl
Straight from the man 5 crontab page. I may have included a few lines too many.
#run at 2:15pm on the first of every month — output mailed to paul
15 14 1 * * $HOME/bin/monthly
# run at 10 pm on weekdays, annoy Joe
0 22 * * 1-5 mail -s “It’s 10pm” joe%Joe,%%Where are your kids?%
May 14, 2023, 9:48pm
0 works fine. Something else is causing the behavior you’re seeing, though I don’t know what.
The cron daemon is provided by your OS, so if there’s anything weird about it, it’d be a question for Debian devs. But, I’m 100% sure they wouldn’t make
0 act weird, so it has to be something else.
May 15, 2023, 1:07am
I’m on Debian 11 too. The cron syntax was from the backup wizard.
Quite strange, but since I’ve changed the email where the output goes (
Cronjob email per virtual server - #2 by Joe) it seems that it did indeed also run on 0 hour. Strange that it did not mail to the root that time and it did on 1 hour.
Maybe I jumped into conclusions to quick, I will go back testing.
0 hour seems to be just fine, nothing special about it
May 23, 2023, 4:02am
This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.