Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set cron job to run every minute between 11 PM to 12AM Midnight

Tags:

cron

I am setting a Cron Job to run every minute between 10 PM to 11 PM as below and its working fine.

*/1  22-23  *   *   *

But when I want to set up it between 11PM to 12AM (Midnight)as below

*/1 23-00   *   *   *

Its showing error as low limit value no. (i.e 23) should be less than higher limit (i.e 00). I have searched on google (or say stackoverflow :D) but have not find any way to run a cron job between 11PM-12AM.

like image 395
prograshid Avatar asked Mar 12 '23 13:03

prograshid


1 Answers

After doing some research on google I find its answer and it is very easy.

Just include a particular hour or range (between 0,23) in hour column i.e 2nd columns

*  22-23,23,0-9   *   *   *

This will run a con job for every minute starting from 10:00 PM to 09:00 AM

like image 67
prograshid Avatar answered Mar 26 '23 01:03

prograshid