Fix backup-home service

This commit is contained in:
Torjus Håkestad 2024-03-06 15:16:40 +01:00
parent db4cdfa886
commit 993c40225e

View File

@ -11,7 +11,7 @@ let
retval=$? retval=$?
if [ $retval -ne 0 ]; then if [ $retval -ne 0 ]; then
echo "Failed to send notification" echo "Failed to send notification"
exit 1 exit $retval
fi fi
# Do the backup # Do the backup
@ -19,11 +19,12 @@ let
${pkgs.restic}/bin/restic backup /home/torjus \ ${pkgs.restic}/bin/restic backup /home/torjus \
--exclude '/home/torjus/.cache' \ --exclude '/home/torjus/.cache' \
--exclude '/home/torjus/.local/share/Steam' \ --exclude '/home/torjus/.local/share/Steam' \
--exclude '/home/torjus/.local/share/containers' \
--exclude '/home/torjus/git/nixpkgs' --exclude '/home/torjus/git/nixpkgs'
retval=$? retval=$?
if [ $retval -ne 0 ]; then if [ $retval -ne 0 ]; then
${pkgs.libnotify}/bin/notify-send -u critical "Backup failed" "Backup of /home/torjus failed" ${pkgs.libnotify}/bin/notify-send -u critical "Backup failed" "Backup of /home/torjus failed"
exit 1 retval=$?
fi fi
# Remove old snapshots and prune # Remove old snapshots and prune
@ -48,7 +49,7 @@ let
retval=$? retval=$?
if [ $retval -ne 0 ]; then if [ $retval -ne 0 ]; then
echo "Failed to send notification" echo "Failed to send notification"
exit 1 exit $retval
fi fi
''; '';
in in