I've got a shell script. It is supposed to be executed automatically on and on over time. Maybe about three times a day. But I don't want to write a cron job for it since it's not the same time every day. Rather, my shell script knows after execution by itself when it wants to be executed for the next time. Is there a possibility to tell the system to call it again at that time? I don't want to implement it with long sleeps since I want the task to be quit after it did its computation.


2 Answers 2


Do you have the possibility to install the at command ? (sudo apt-get install at)

If so, you can add a call at the end of your script, and timing it with the parameters you want

For example, you can add this at the end of your script to execute it again 2 hours later:

at now +2 hours -f myScript.sh

Maybe with at command ?

at -M -f $script_name now + $time minute

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .