3

So just to sketch the outlines of this problem, i made an cronjob that should be executed on each full hour like this: 0:00, 1:00, 2:00. In all the manuals/tutorials i found on the internet they say putting in a crontab like this would do the trick:

0 * * * * echo "HourlyCronJobTest" > /home/sajvanderzeeuw/myCRON.txt

Unfortunately this does not work. Every other number of minutes does work. E.g. the job below which creates the text file at every 35 minutes of the hour. 0:35, 1:35 etc etc.

35 * * * * echo "HalfHourCronjobTest" > /home/sajvanderzeeuw/myCRON2.txt

So there is a easy way to circumvent this by simple doing it at 1 minute past the hour. But i just wonder if someone can show me why this happens.

  • What's the output of uname -a? – Gx1sptDTDa Jul 20 '15 at 14:23
  • @Gx1sptDTDa Linux shark 3.13.0-55-generic #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux – Sander Van der Zeeuw Jul 20 '15 at 14:25
  • 1
    look strange, this should work, try @hourly (in place of "0 * * * *") – Archemar Jul 20 '15 at 14:25
  • I know that this is also possible. Trying as we speak. But still this does not declare why it doesnt work for 0 * * * * – Sander Van der Zeeuw Jul 20 '15 at 14:29
  • Very strange. Which version of cron do you have installed? – mjturner Jul 20 '15 at 15:02
0

Problem is solved. It was not due to a bug in Cron but it was because the LDAP client of our compute cluster was restarted on the hour. So therefore all CRONjobs scheduled at this time weren't executed, because the cluster couldn't recognize user IDs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.