diff --git a/backup.nix b/backup.nix index 7e95b6a..1accf0a 100644 --- a/backup.nix +++ b/backup.nix @@ -8,10 +8,13 @@ let pkgs.systemd ]; text = '' + if [ "$#" -ne 1 ]; then + echo "Need exactly one argument, the path to backup."; + exit 1; + fi echo "Starting backup."; - path="$(systemd-escape -u --path ''${1})"; + path="$(systemd-escape -u --path \"$1\")"; restic backup "$path"; - restic forget -d 7 -w 4 -m 6 --keep-within 1d --prune ''; }; in