vendredi 13 avril 2018

Cron schedule a task alleatory in a range of hours

I want schedule with cron a task to be ran ONCE in between a certain tange of hours, not every hour in a range.

Example: I want it may run ONCE between 9 to 12 hours, single time. Better if I can run the task ONCE between 9 to 12 hours and random minute as well. I don't want can be predictable, but I want keep control about in which range of hours it will be fired.

I tried:

# m h  dom mon dow   command
00-59 09-12 * * 2 /home/osmc/play.sh

But it ran every minute, between 00 and 59, for every hour between 9 to 12 (not desired)

Any idea how I can do so?




Aucun commentaire:

Enregistrer un commentaire