Rework systemd unit examples
Amolith
created 1 month ago
Rename keld-verify to keld-integrity with --read-data for monthly full
data verification. The daily backup unit now chains backup && check in a
single ExecStart via /bin/sh -c.
Rename env files from %I.env and %I-verify.env to %i_backup.env and
%i_integrity.env, using %i (escaped instance) for consistent file
naming.
Change summary
examples/systemd/user/keld-backup@.service | 4 ++--
examples/systemd/user/keld-integrity@.service | 9 +++++++++
examples/systemd/user/keld-integrity@.timer | 2 +-
examples/systemd/user/keld-verify@.service | 9 ---------
4 files changed, 12 insertions(+), 12 deletions(-)
Detailed changes
@@ -5,5 +5,5 @@ Description=keld %I backup
Nice=19
IOSchedulingClass=idle
KillSignal=SIGINT
-EnvironmentFile=-%h/.config/keld/timers/%I.env
-ExecStart=%h/.local/bin/mise x github:bdd/runitor -- runitor -- mise x http:keld -- keld --preset %I backup
+EnvironmentFile=-%h/.config/keld/timers/%i_backup.env
+ExecStart=/bin/sh -c '%h/.local/bin/mise x github:bdd/runitor -- runitor -- /bin/sh -c "mise x http:keld -- keld --preset %i backup && mise x http:keld -- keld --preset %i check"'
@@ -0,0 +1,9 @@
+[Unit]
+Description=keld %I integrity check (read-data)
+
+[Service]
+Nice=19
+IOSchedulingClass=idle
+KillSignal=SIGINT
+EnvironmentFile=-%h/.config/keld/timers/%i_integrity.env
+ExecStart=%h/.local/bin/mise x github:bdd/runitor -- runitor -- mise x http:keld -- keld --preset %i check --read-data
@@ -1,5 +1,5 @@
[Unit]
-Description=Monthly keld %I verify
+Description=Monthly keld %I integrity check
[Timer]
OnCalendar=monthly
@@ -1,9 +0,0 @@
-[Unit]
-Description=keld %I verify
-
-[Service]
-Nice=19
-IOSchedulingClass=idle
-KillSignal=SIGINT
-EnvironmentFile=-%h/.config/keld/timers/%I-verify.env
-ExecStart=%h/.local/bin/mise x github:bdd/runitor -- runitor -- mise x http:keld -- keld --preset %I check