Date: Sat, 21 Aug 2010 00:17:08 -0400 From: jhell <jhell@DataIX.net> To: Alexander Leidinger <netchild@freebsd.org> Cc: FreeBSD Stable <freebsd-stable@freebsd.org> Subject: Fwd: daily run output 800.scrub-zfs fixups Message-ID: <4C6F5344.6040808@DataIX.net>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------080104090904040603090909 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi Alexander, Attached is a fix for one problem and one slight overlook for 800.scrub-zfs. The first & second change was probably just an oversight but none the less they both give a false impression of actions taken. Change1: ${daily_scrub_zfs_default_threshold=30} is missng the ':' which would ultimately reset the users supplied value in periodic.conf to 30. Change2: ${_scrub_diff} -le ${_pool_threshold} would cause the scrub to be run on the day after the threshold was met. So I changed '-le' -> '-lt' which causes it to be run on the 30th day instead of the 31st day. Regards & Thank you again for merging this to stable/8. PS: If you would like a PR filed for this I can do that just let me know. -------- Original Message -------- Subject: xxxxxx.dataix.local daily run output Date: Fri, 20 Aug 2010 03:18:09 -0400 (EDT) From: Superuser Root <root@xxxxxx.dataix.local> To: root@xxxxxx.dataix.local ...snip... Scrubbing of zfs pools: skipping scrubbing of pool 'exports': last scrubbing is 30 days ago, threshold is set to 30 days -- End of daily output -- --------------080104090904040603090909 Content-Type: text/x-patch; name="800.scrub-zfs.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="800.scrub-zfs.diff" Index: etc/periodic/daily/800.scrub-zfs =================================================================== --- etc/periodic/daily/800.scrub-zfs (revision 211527) +++ etc/periodic/daily/800.scrub-zfs (working copy) @@ -11,7 +11,7 @@ source_periodic_confs fi -: ${daily_scrub_zfs_default_threshold=30} +: ${daily_scrub_zfs_default_threshold:=30} case "$daily_scrub_zfs_enable" in [Yy][Ee][Ss]) @@ -53,7 +53,7 @@ # Now minus last scrub (both in seconds) converted to days. _scrub_diff=$(expr -e \( $(date +%s) - \ $(date -j -f %F.%T ${_last_scrub} +%s) \) / 60 / 60 / 24) - if [ ${_scrub_diff} -le ${_pool_threshold} ]; then + if [ ${_scrub_diff} -lt ${_pool_threshold} ]; then echo " skipping scrubbing of pool '${pool}':" echo " last scrubbing is ${_scrub_diff} days ago, threshold is set to ${_pool_threshold} days" continue --------------080104090904040603090909 Content-Type: text/plain; name="800.scrub-zfs.diff.asc" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="800.scrub-zfs.diff.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iQEcBAABAgAGBQJMb07lAAoJEJBXh4mJ2FR+OF8H/RVSV15D0q2JSYjPrjr0dFSR +dD+GOOU4ZZr5cP1oNsodIbc2CiYia6Y/TUVT39WiHF9+Pu/r9EiYG9fxvTVfeIY pHgW5nrrDDnZU8oRNb/2k7vhwaPMXm5UUw9TlqtOL+Cx3ZpprBE2/I8sRrJutOoo Hf5BaVDosmumJtEykI9Xg4Hkwdq18v+FIBVwxPWb0f0aUwnV9OS9XfCM3Quf50OF ba+94EZH/2gQvGrFHb2jH9c2tYZXvtzEpSuFRFEHrbNPVpO6jjPBIQHN9xvmJwD/ 2Pih6QXBIN7cfwvXpEzzbLSlIMHv7bc8Ushi1/0voIi932JJQr5/VY6DwmQvkRU= =M7Vr -----END PGP SIGNATURE----- --------------080104090904040603090909--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C6F5344.6040808>