From fd6d93d0cf771b877ffaa5c294bbc06a7e1814e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Wed, 6 Mar 2024 19:59:17 +0100 Subject: [PATCH] Improve backup script --- home/services/backup-home.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/home/services/backup-home.nix b/home/services/backup-home.nix index ef3ca41..f5eb077 100644 --- a/home/services/backup-home.nix +++ b/home/services/backup-home.nix @@ -11,7 +11,6 @@ let retval=$? if [ $retval -ne 0 ]; then echo "Failed to send notification" - exit $retval fi # Do the backup @@ -25,6 +24,12 @@ let if [ $retval -ne 0 ]; then ${pkgs.libnotify}/bin/notify-send -u critical "Backup failed" "Backup of /home/torjus failed" retval=$? + if [ $retval -ne 0 ]; then + # TODO: put token in sops + ${pkgs.curl}/bin/curl "https://gotify.t-juice.club/message?token=ABgV8XT62bxyCzF" \ + -F "title=Backup of home@gunter failed!" \ + -F "message=Please check status of backup-home service" + fi fi # Remove old snapshots and prune