1

I need to configure cronjob at specific time, like every 50 minutes from 9 to 23 pm. And I am trying

  • */50 9-23 ***

But it runs at 9:50 and also at 10:00, I need some help. Thanks.

Igor Lantushenko
  • 1,771
  • 10
  • 19
  • Possible duplicate on http://stackoverflow.com/questions/8181949/how-do-set-cron-to-run-my-script-every-40mins-25mins – Pavel Štěrba Feb 10 '14 at 13:08
  • I saw that, and actually they made 2 cron jobs for 40 minutes interval, for 0,40 */2 and 20 1,3,5.... but its not really good solution for me. – Igor Lantushenko Feb 10 '14 at 13:17

1 Answers1

2

The time range you define it is converted into:

9 50
10 40
11 30
12 20
13 10
14 00
15 50 -
16 40
17 30
18 20
19 10
20 00
20 50 -
21 40
22 30

So that you need to define these different cronjobs:

50 9,15,20 * * *
40 10,16,21 * * *
30 11,17,22 * * *
20 12,18 * * *
10 13,19 * * *
00 14,20 * * *
fedorqui
  • 275,237
  • 103
  • 548
  • 598
  • Thanks, looks good. But is there any other way to make it more flexible,I mean f.e. if I need every 48, or 40 minutes then need to change a lot:) – Igor Lantushenko Feb 10 '14 at 13:34
  • Well, if you write all the times then you can group them. With 40 will get many similarities, just three groups. – fedorqui Feb 10 '14 at 13:35
  • Why did you unaccept? It is not my fault that cronjob is not that flexible :) – fedorqui Feb 10 '14 at 13:37