I have a command that I want to run regularly, i.e. at fixed intervals (say once per day).
As far as I know, the usual approach would be to use cron. That would require me to schedule my task at specific times (say every day at midnight). In my case, however, the target machine is not running continuously, so it might not be running at the scheduled time every day.
I'm therefore looking for some kind of background service that uses the elapsed time since the last command invokation instead of a specific time when deciding whether to execute the command or not.
For example, assume that the last execution of the command was two days ago at noon and that the machine was shut down afterwards. Now the machine starts up again for the first time since then. The daemon notices that more than a day has passed since the last invokation and runs the command (no matter what the current time is). If the machine keeps running for at least 24h afterwards then the command will be executed again after 24h.
Obviously I could hack something together which is called by cron on a more frequent basis and performs the necessary checks itself, but I was wondering if there exists a ready solution for this kind of problem.