5

For testing purposes ,I would like to run a command check every 15 minutes past the hour. I'm a little bit confused about the correct timeframe syntax of the crontab :

Is this correct :

*/15 * * * * 

or

this one :

15 * * * *

I think its the first one ,since the second will run 15 minutes (once) after 1 hour passed. Any ideas?

15

The first one will (with most common cron implementations) run the command every 15 minutes and is equivalent to 0,15,30,45 * * * *.

The second one will run 15 minutes past the hour, every hour.

This is described in the crontab(5) manual on your system (man 5 crontab).

  • @VorX I think I slightly misread your question and have amended the answer... I hope that it's still clear. – Kusalananda Jan 30 '18 at 9:17
2

Your first crontab line means running a command every 15 minutes.

The second one means running a command 15 minutes after every hour.

0

The first one will execute at every 15th minute, that is xxh15; xxh30; xxh45; (xx + 1)h00.

The second one will execute at minute 15. Ex: xxh15; (xx + 1)h15; (xx + 2)h15.

If you have any doubts in how to set a crontab I recommed you to check the crontab guru.

-3

This one is correct

*/15 * * * * 

Also, check the crontab.guru website.

  • It depends on how you interpret "every 15 minutes past the hour" in the question. It's either "every 15 minutes" or "15 minutes past every hour". – Kusalananda Jan 30 '18 at 13:31

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.