at
has a simpler interface for this type of purpose if at
is installed, the machine is running atd
and the user is allowed to use the command.
For example (check the exact syntax using man at
or info at
),
at -f
file now + 53 minutes
or
at -f
file now + 2 hours
will run the commands in the specified file in 53 minutes or 2 hours, respectively.
at
can then be re-run at the start of the scheduled job with suitable (random or otherwise) start, count, and time-units.
Edit
As Arjan points out helpfully below, if you are using this for other than a toy application you need to think about issues such as what happens
if the next run starts before the previous one finishes (e.g. is the script re-entrant?) or
if a run fails to complete correctly or
if the next run fails to start at all or on time (e.g. what happens if the machine is off when the next run is due to start) and
about the logging and reporting of failed or successful runs.