Fix backup-home service
This commit is contained in:
parent
db4cdfa886
commit
993c40225e
@ -11,7 +11,7 @@ let
|
||||
retval=$?
|
||||
if [ $retval -ne 0 ]; then
|
||||
echo "Failed to send notification"
|
||||
exit 1
|
||||
exit $retval
|
||||
fi
|
||||
|
||||
# Do the backup
|
||||
@ -19,11 +19,12 @@ let
|
||||
${pkgs.restic}/bin/restic backup /home/torjus \
|
||||
--exclude '/home/torjus/.cache' \
|
||||
--exclude '/home/torjus/.local/share/Steam' \
|
||||
--exclude '/home/torjus/.local/share/containers' \
|
||||
--exclude '/home/torjus/git/nixpkgs'
|
||||
retval=$?
|
||||
if [ $retval -ne 0 ]; then
|
||||
${pkgs.libnotify}/bin/notify-send -u critical "Backup failed" "Backup of /home/torjus failed"
|
||||
exit 1
|
||||
retval=$?
|
||||
fi
|
||||
|
||||
# Remove old snapshots and prune
|
||||
@ -48,7 +49,7 @@ let
|
||||
retval=$?
|
||||
if [ $retval -ne 0 ]; then
|
||||
echo "Failed to send notification"
|
||||
exit 1
|
||||
exit $retval
|
||||
fi
|
||||
'';
|
||||
in
|
||||
|
Loading…
Reference in New Issue
Block a user