I want to run a cronjob once every day on a machine that doesn't run all the time, but runs at least once a day for a couple of hours. The problem with a cronjob is, that I have to give it the exact time, when it is supposed to run, but my machine may not be running at this particular time. I know there is an option to cron that says "do this, when booting" but my machine usually isn't rebooted, but I leave it in standby. Put differently, I want to execute something once a day, but I can't give an exact time. Is there a solution to this?
|
feedback
|
|
You want something like anacron:
Available as packages in most Linux distributions. There's probably also a port for MS Windows... | |||
|
feedback
|
|
How you tried Example:
| |||||
feedback
|
|
You could invoke the job from a startup script in /etc/rc2.d which compares today's date with one saved in a file and then updates that file. | |||
|
feedback
|