Question

Why Crontab AT 1AM Not Work, but it does at another hour?

Greetings. I have created a certain number of cronjobs (15) to be executed at certain time, but Im having issues with the time of the job, for example:

 5 1 * * * Command to be executed

Doesn’t run, but if I do something like this:

 5 10 * * * Command to be executed

Runs perfectly.

I don’t know if this have something to do with the date/timezone that I setted to my vps.

Thank you for your attention.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

This is an old one, but just stumbled across it now. Hopefully this will be useful for people still landing here from search. What I suspect was happen here was that /var/log/syslog was being rotated after the command was successfully run but before you checked the logs.

logrotate is run daily via it’s entry in /etc/cron.daily/:

# ls /etc/cron.daily/
apport      bsdmainutils  logrotate  mdadm    passwd              update-notifier-common
apt-compat  dpkg          man-db     mlocate  popularity-contest

Scripts in /etc/cron.daily/ are run daily at 06:25:

# grep '/etc/cron.daily' /etc/crontab
25 6	* * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

So if you check /var/log/syslog after that point in time, it may not contain entries from before then. To confirm if this is why you can not find a log entry, check /var/log/syslog.1 for older ones.