Improve backup script
Some checks failed
pre-commit / pre-commit (push) Has been cancelled

This commit is contained in:
Torjus Håkestad 2024-03-06 19:59:17 +01:00
parent 6a82a8638d
commit fd6d93d0cf

View File

@ -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