daily backup: wait until nix-gc has finished

This commit is contained in:
Daniel Langbein 2025-02-28 16:05:00 +01:00
parent c3925cc33f
commit 24afb85194
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002

View File

@ -127,6 +127,16 @@ in
sleep 60s sleep 60s
done done
# Wait until no nix garbage collection service is running.
while :; do
running_services="$(systemctl list-units --type=service --plain --quiet | awk '{ print $1 }')"
if ! printf '%s' "''${running_services}" | grep '^nix-gc.service$'; then
break;
fi
printf '%s\n' 'Delaying suspend due to running nix garbage collection service.'
sleep 60s
done
# Send filtered journal by email. # Send filtered journal by email.
systemctl start journalwatch.service ||: systemctl start journalwatch.service ||:
# Send notification by email. # Send notification by email.