Home » Linux » How to run cron every 20 minutes but not hour

How to run cron every 20 minutes but not hour

Posted by: admin January 12, 2018 Leave a comment

Questions:

How to run cron every 20mins so like this:

00:20, 00:40, 01:20, 01:40 etc all the way but not at :00

What should I put in crontab?

Answers:

A line like

20,40 * * * * /path/to/job

should trigger the job only whenever the minute part of the time is 20 or 40.

If you are putting this in the system’s crontab, add a username after that last star.

Questions:
Answers:

Add following line in crontab

20,40 * * * * sh your_script.sh

Questions:
Answers:

*/20 * * * * /path/to/script.sh