![Hacker Public Radio artwork](https://is2-ssl.mzstatic.com/image/thumb/Podcasts113/v4/6e/8f/a8/6e8fa80a-9edd-225f-394b-2a6c8c473614/mza_6915183156681029220.png/100x100bb.jpg)
HPR3398: Anacron
Hacker Public Radio
English - August 11, 2021 00:00 - 7.53 MB - ★★★★ - 34 ratingsTechnology News Tech News community radio tech interviews linux open hobby software freedom Homepage Download IPFS Apple Podcasts Google Podcasts Overcast Castro Pocket Casts RSS feed
Setup
$ mkdir -p ~/.local/etc/cron.daily ~/.var/spool/anacron
Create a file called anacrontab:
$ touch /.local/etc/anacrontab
Set it up to trigger scripts in your cron.daily folder:
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
1 0 cron.daily run-parts $HOME/.local/etc/cron.daily/
Validate your anacrontab:
$ anacron -T -t ~/.local/etc/anacrontab -S ~/.var/spool/anacron
Start anacron in a file that gets triggered at login, such as ~/.profile:
anacron -t $HOME/.local/etc/anacrontab -S $HOME/.var/spool/anacron
Using
Now that everything is set up, just put scripts you want to run regularly in cron.daily, and make them executable.
You can set up a weekly directory, too. Just set the time interval in your anacrontab to:
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
7 0 cron.weekly run-parts $HOME/.local/etc/cron.weekly/