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 I don't know if there is a "correct" way to do this, but periodic is launched by cron. Here's the relevant line from my /etc/crontab:

1 3 * * * root periodic daily

You should be able to edit yours to something like this:

@reboot root periodic

@uastronomer thank you, that could also work, I've gone with anacron and edited the post.