From 90b8c92ec656000af5bb9d1605a940f32ed3f7db Mon Sep 17 00:00:00 2001 From: Christoph Klaffl Date: Sun, 31 Mar 2019 15:21:19 +0200 Subject: [PATCH] sanoid-prune.service is indeed referenced and run after the sanoid.service Revert "Fix systemd service definitions." This reverts commit 17e15c2f54843e0f2c1ecff234e2e83f89c1c77f. --- INSTALL.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 8b9b31d..c4063a4 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -75,7 +75,7 @@ Create a systemd service: ```bash cat << "EOF" | sudo tee /etc/systemd/system/sanoid.service [Unit] -Description=Sanoid ZFS Snapshot Manager +Description=Snapshot ZFS Pool Requires=zfs.target After=zfs.target ConditionFileNotEmpty=/etc/sanoid/sanoid.conf @@ -83,7 +83,23 @@ ConditionFileNotEmpty=/etc/sanoid/sanoid.conf [Service] Environment=TZ=UTC Type=oneshot -ExecStart=/usr/local/sbin/sanoid --cron --verbose +ExecStart=/usr/local/sbin/sanoid --take-snapshots +EOF + +cat << "EOF" | sudo tee /etc/systemd/system/sanoid-prune.service +[Unit] +Description=Cleanup ZFS Pool +Requires=zfs.target +After=zfs.target sanoid.service +ConditionFileNotEmpty=/etc/sanoid/sanoid.conf + +[Service] +Environment=TZ=UTC +Type=oneshot +ExecStart=/usr/local/sbin/sanoid --prune-snapshots + +[Install] +WantedBy=sanoid.service EOF ```