mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 10:01:01 +03:00
2300621dc7
Timers can be enabled as follows: systemctl enable zfs-scrub-weekly@rpool.timer --now systemctl enable zfs-scrub-monthly@datapool.timer --now Each timer will pull in zfs-scrub@${poolname}.service, which is not schedule-specific. Added PERIODIC SCRUB section to zpool-scrub.8. Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> Closes #12193
15 lines
422 B
SYSTEMD
15 lines
422 B
SYSTEMD
[Unit]
|
|
Description=zpool scrub on %i
|
|
Documentation=man:zpool-scrub(8)
|
|
Requires=zfs.target
|
|
After=zfs.target
|
|
ConditionACPower=true
|
|
ConditionPathIsDirectory=/sys/module/zfs
|
|
|
|
[Service]
|
|
ExecStart=/bin/sh -c '\
|
|
if @sbindir@/zpool status %i | grep "scrub in progress"; then\
|
|
exec @sbindir@/zpool wait -t scrub %i;\
|
|
else exec @sbindir@/zpool scrub -w %i; fi'
|
|
ExecStop=-/bin/sh -c '@sbindir@/zpool scrub -p %i 2>/dev/null || true'
|