0

i am looking to execute a crone job in Linux. it should run every 3 hour and 40 minutes.

I have tried */40 */3 * * * command, I am not getting this properly executed.

thanks in advance .

Sam
  • 5
  • 4
  • that's not possible with cron. you can only specify repeat intervals for the individual time elements, not for arbitrary times lengths that COMBINE those time elements. you'd need to use `at` and have the job reschedule itself – Marc B Jul 05 '16 at 16:02
  • thanks for answering , what do you mean by using at – Sam Jul 05 '16 at 16:17
  • `at` is a cousin of cron, for one-shot jobs scheduled "at" specific times. run your job, then have it reschedule itself with `at` for `now() + 220 minutes` – Marc B Jul 05 '16 at 16:18
  • thanks, I got some idea as "at -f command.sh now + 72 minutes" – Sam Jul 05 '16 at 16:31

1 Answers1

1

cron is time based, not interval based, and the interval 3 hour 40 minutes i.e. 220 minutes is not a factor of the number of minutes in a day i.e. 24x60=1440, so the event is not a recurring event. so there is no way to use cron. if the interval is a factor of 1440, it's possible to use cron, you may refer to How to do a cron job every 72 minutes

Community
  • 1
  • 1
Shing Lam
  • 81
  • 6