From 14fed8bc6e6ffdd0053ac8bc114d16f8d90e02cb Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 18 Feb 2022 21:10:50 +0100 Subject: [PATCH] bundles/zfs: move scrub to systemd-timer --- bundles/zfs/metadata.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/bundles/zfs/metadata.py b/bundles/zfs/metadata.py index ba301f1..5807f8c 100644 --- a/bundles/zfs/metadata.py +++ b/bundles/zfs/metadata.py @@ -87,6 +87,10 @@ defaults = { 'when': 'weekly', 'command': '/usr/local/sbin/zfs-auto-snapshot weekly', }, + 'zfs-scrub': { + 'when': 'Sun 02:00:00 UTC', + 'command': '/usr/lib/zfs-linux/scrub', + } }, }, 'zfs': { @@ -135,20 +139,6 @@ if node.has_bundle('telegraf'): } -@metadata_reactor.provides( - 'cron/jobs/zfs-scrub', -) -def zfs_scrub_cronjob(metadata): - when = metadata.get('zfs/scrub/cron', '{} 0 * * sun'.format((node.magic_number % 60))) - return { - 'cron': { - 'jobs': { - 'zfs-scrub': '{} root /usr/lib/zfs-linux/scrub'.format(when), - }, - }, - } - - @metadata_reactor.provides( 'icinga2_api/zfs/services', )