Cron vs. Whenjobs vs. Goaljobs
Wolfgang S. Rupprecht
wolfgang.rupprecht at gmail.com
Wed Dec 18 20:31:26 UTC 2013
Jonathan Ryshpan <jonrysh at pacbell.net> writes:
> In more detail: I have a cron job which backs up my desktop system
> every day. The job is actually invoked by anacron, which starts it
> about an hour after I boot up the system for the day. Backing up takes
> from half an hour to an hour and a half, depending.
>
> * Frequently, I start the system, check my email and leave for
> breakfast; on these days, I'd like backup to start when I leave; I
> would invoke it by a shell script or whatever.
>
> * Other days, I stay on the system for a while; on these days I'd like
> cron to start the job whenever its algorithms think best.
>
> * I don't want to leave starting the job completely to a shell script
> run from a terminal, because I'd often forget to run it.
>
Why not run /etc/cron.hourly/0anacron just before leaving for breakfast
(or give it an easier to remember alias like "run-anacron-now")?
What I do here the systems that are booted infrequently is add this to
/etc/crontab:
@reboot root /etc/cron.hourly/0anacron
and change /etc/anacrontab:
# the maximal random delay added to the base delay of the jobs
RANDOM_DELAY=2
# the jobs will be started during the following hours only
START_HOURS_RANGE=0-24
-wolfgang
More information about the users
mailing list