Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run cron every 20 minutes but not hour

Tags:

linux

unix

cron

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?

like image 861
user1729362 Avatar asked Jun 26 '13 17:06

user1729362


2 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.

like image 106
cHao Avatar answered Oct 01 '22 14:10

cHao


Add following line in crontab

20,40 * * * * sh your_script.sh

like image 43
Sandeep Avatar answered Oct 01 '22 16:10

Sandeep