git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/znapzend: fix when no previous zetup

When the znapzend module was enabled for the first time with pure = true; then the list of previous entries is empty, but xargs still tried to execute a znapzendzetup delete command with no arguments, which made it fail

commitc2b8d14b56f70b220b4c7c253036a3b3778a6780 authorSilvan Mosberger <infinisil@icloud.com> dateSat 17 Feb 2018, 15:50 (9 years ago) parent588fe10
1 file changed+1−1
nixos/modules/services/backup/znapzend.nix+1−1
nixos/modules/services/backup/znapzend.nix+1−1
@@ -386,7 +386,7 @@ in
386386 echo Resetting znapzend zetups
387387 ${pkgs.znapzend}/bin/znapzendzetup list \
388388 | grep -oP '(?<=\*\*\* backup plan: ).*(?= \*\*\*)' \
389− | xargs ${pkgs.znapzend}/bin/znapzendzetup delete
389+ | xargs -I{} ${pkgs.znapzend}/bin/znapzendzetup delete "{}"
390390 '' + concatStringsSep "\n" (mapAttrsToList (dataset: config: ''
391391 echo Importing znapzend zetup ${config} for dataset ${dataset}
392392 ${pkgs.znapzend}/bin/znapzendzetup import --write ${dataset} ${config}