I'm back with another #FreeBSD question, specifically about `periodic`. I'd like to use `periodic daily` to occasionally scrub my ZFS pools by setting `daily_scrub_zfs_enable` to `"YES"` in `/etc/periodic.conf`. This works great on a server, because it's always on, but not so great on my laptop, because the cron is scheduled at night. I could change the time, but then it'll only run if my laptop is on at the right time.

Is there a way to schedule this so the `periodic` crons are run after booting, in case there are "missed" runs? What is the recommended approach here, use e.g. Xfce's autostart applications for this?

Edit: solved! The answer is anacron

Thanks for reading :)

#cron #periodic #zfs

@kedara Could directly run the actual ZFS scrub script on boot via "crontab(5)" ...

@reboot -n sleep 134 && /etc/periodic/daily/800.scrub-zfs

... with "daily_scrub_zfs_enable"d (🙄preferable would be to refactor the part for the "case" of "[Yy][Ee][Ss]" in its own script in order to not have to rely on extra moving part).

@ax6761 thanks, I went with anacron: easy to setup, and now I can make full use of other periodic scripts.