Tomkay Tomkay - 3 months ago 11
Linux Question

Using crontab to execute script between 17:00–20:00 for every 10 minutes

I want to send emails to clients every day between 17:00 to 20:00. I want to run my command every 10 minutes in this period.
So the script will be executed 6 times per hour. That's a total of 18 times.

Is this possible with the crontab? How should I write the syntax?

Answer

I think this should work:

0/10 17-19 * * *  <cmd>

or:

0/10 17,18,19 * * * <cmd>
Comments