Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cron expression for each 5 minutes except hours between 01:00 and 02:00?

Tags:

cron

My need is clear in the title. Any help would be appreciated.

like image 297
javatar Avatar asked Apr 18 '12 14:04

javatar


People also ask

How do I schedule a script in crontab to run every 5 minutes?

tiny 4. /bin/ed Choose 1-4 [1]: Make a new line at the bottom of this file and insert the following code. Of course, replace our example script with the command or script you wish to execute, but keep the */5 * * * * part as that is what tells cron to execute our job every 5 minutes. Exit this file and save changes.

What is the use of * * * * * In cron?

* * * * * is a cron schedule expression wildcard, meaning your cron job should run every minute of every hour of every day of every month, each day of the week.

What does cron 0 * * * * * mean?

*/5 * * * * Execute a cron job every 5 minutes. 0 * * * * Execute a cron job every hour.


2 Answers

Did you try this :

0 0/5 0,2-23 * * ?
like image 127
kyiu Avatar answered Sep 21 '22 14:09

kyiu


Try something like this 0 0/5 0,2-23 * * ?

like image 24
JavaKungFu Avatar answered Sep 22 '22 14:09

JavaKungFu