1

I must have done something wrong in crontab, but I don't see what. The entry below is executing demo-off.sh once a MINUTE beginning at 10 and going till 11.

* 10 * * 4,6  /home/username/demo-off.sh 2> /home/username/demo-off.log

Here is cron.log (shortened)

Aug 16 10:00:01 machine-name CROND[20680]: (username) CMD (/home/username/demo-off.sh 2> /home/username/demo-off.log)
Aug 16 10:01:01 machine-name CROND[20813]: (username) CMD (/home/username/demo-off.sh 2> /home/username/demo-off.log)
Aug 16 10:02:01 machine-name CROND[20887]: (username) CMD (/home/username/demo-off.sh 2> /home/username/demo-off.log)
    ...
Aug 18 10:57:01 machine-name CROND[9690]: (username) CMD (/home/username/demo-off.sh 2> /home/username/demo-off.log)
Aug 18 10:58:01 machine-name CROND[11257]: (username) CMD (/home/username/demo-off.sh 2> /home/username/demo-off.log)
Aug 18 10:59:02 machine-name CROND[13065]: (username) CMD (/home/username/demo-off.sh 2> /home/username/demo-off.log)

Can someone push me in the right direction in terms of what I did wrong?

  • 1
    What you did wrong depends on what you wanted instead ;-) – PerlDuck Aug 23 '18 at 16:18
  • 1
    You used a wildcard (* = all), in the Minute field, so all minutes during that hour match the criteria. – user535733 Aug 23 '18 at 16:39
4

I don't try to figure it out, I just use the handy-dandy corntab.com cron gui.

It says that sure enough, what you wrote will run every minute starting at 10:00 on Thursday and Saturday.

enter image description here

I suggest you use corntab to get what you really want - if nothing else, it's an easy way to test your cron entries.

Note: No vested interest in corntab, just a satisfied user.

  • 1
    Saves you a ton of thinking especially if your me :-) – George Udosen Aug 23 '18 at 16:21

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.