My question is kinda related to a cron job I think, but I'm not entirely sure.
Say I have a script (/home/me/myscript.sh
) that does something, that can take an indeterminate amount of time to finish, say a range of between 10 minutes to an hour. What I want, is for the script to run, and when it finishes, run again in an hour. Is there any kind of "scheduler" or something that I could use to achieve this? I'm using Ubuntu.
Best Answer
cron
sounds unsuitable for this; an hour after the completion of the previous run could either be done via awhile
loopor by scheduling the next run in one hour via
at(1)
at the end of the job.There may need to be sanity checks or a
timeout
on the job, in the event it gets stuck and thus no subsequent jobs run until someone manually kills it and restarts things.