anacron for non-root
anacron is launched by root to excecute system-wide task, e.g.
Non-root users have access to
cron but normally can not execute
anacron, which seems somewhat
unreasonable. Suppose you want to allow user
shalaev to run his personal anacron tasks.
Type the following under root account:
groupadd anacron adduser shalaev anacron mkdir /var/spool/shalaev-anacron chgrp anacron /var/spool/shalaev-anacron chmod g+rwx /var/spool/shalaev-anacron
Next, log in as
shalaev and copy the following into
SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # period delay job-identifier command 1 5 shalaev.anacron.daily nice run-parts --report $HOME/anacron.daily
~/anacron.daily and populate it with files which you want to excecute daily.
Do not forget to
chmod +x and remember that program names in
must match certain (default) pattern to be excecuted by
run-parts, see its man page.
will not be launched, but
Finally we remember that (unlike
anacron is not a daemon so it has to be launched manually.
You may launch it from your
~/.profile, for example.
I run it using the following string in my
11 * * * * /usr/sbin/anacron -S /var/spool/shalaev-anacron -t $HOME/anacrontab
anacron hourly. Of course, programs in
~/anacron.daily we run only once a day.