I created a new zpool yesterday. I expected 800.scrub to scrub it last night. It did not. It thinks the last zpool was zero days ago. Scrubbing of zfs pools: skipping scrubbing of pool 'data01': last scrubbing is 6 days ago, threshold is set to 7 days skipping scrubbing of pool 'data02': last scrubbing is 6 days ago, threshold is set to 7 days skipping scrubbing of pool 'data03': last scrubbing is 6 days ago, threshold is set to 7 days skipping scrubbing of pool 'zroot': last scrubbing is 0 days ago, threshold is set to 7 days The truth is: zroot has never had a scrub.
The script uses creation_time if "no scrub was done". I suppose that's a fair compromise.
^Triage: actually, 'conf' is correct for periodic scripts.
(In reply to Mark Linimon from comment #2) Ironically, I moved it to bin after seeing https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261855 in bin (I've since moved it over).
So in essence the issue is just that the message would more correctly be "last scrubbing or pool creation is 0 days ago" maybe "day 0 of 7 until next scrub" or "day 6 of 7 until next scrub" would still be clear but also pedantically correct
(In reply to Ed Maste from comment #4) The background. * I created a new zpool yesterday. * Later, Nagios told me the zpool hadn't been scrubbed yet. * In my head: oh, that will change tonight with the daily scripts run. * This morning: Oh, wait, why didn't it scrub? * Which led me to the script and this PR. Granted: my problem is the Nagios check which doesn't know the difference between "no scrub" and "just created". The counter to this PR is: * just do a scrub and silence the Nagios check * there's no need to do a scrub on a new zpool (I'd argue that there is every reason to do a scrub)