From b1b6f77ca762644ebe6c1f4a889d3fb24e8ce83e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sun, 2 Jun 2024 22:23:36 +0200 Subject: [PATCH] Fix shellcheck --- backup.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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