Cronjob at 0 hour?

SYSTEM INFORMATION
OS type and version Debian 11
Virtualmin version 7.7

Hi,

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:

  • Manual run
  • 1:10 hours
  • 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.

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. :wink:

#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?%

1 Like

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.

1 Like

I’m on Debian 11 too. The cron syntax was from the backup wizard.

Thanks all.

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 :upside_down_face:

Thanks!

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.