Quote:
Originally Posted by rollo
But anacron still isn't running at boot. This seems to be because it is called by the cron.daily/weekly/monthly scripts... and these are scheduled for when the machine is switched off! Isn't this the problem that anacron was trying to solve?
So how do I get anacron to run only at startup? Putting it in /etc/rc5.d doesn't work - I guess because it's not a daemon.
|
By default
anacron does fork to the background. But trying to run it
directly from a runlevel directory will get it called with a
start parameter which it probably wont't like! I believe the normal way to do this is to create a script which calls it and create a symlink in
/etc/rc5.d to that script. Are you sure Debian doesn't already have such a script in
/etc/init.d? You could also start it from your
rc.local script.
FWIW, I have a system that is frequently down, running different distros/OS's etc where I have
anacron called at startup and when coming out of suspend to make sure things get run
and once a day from
cron. This is how I run cron.daily. I did it this way because I found it annoying when cron.daily ran twice within a short period of time because
cron doesn't know about
anacron's timestamps. This way it is guaranteed to run once and only once a day.