diff options
author | Silvan Mosberger <infinisil@icloud.com> | 2018-02-17 15:50:48 +0100 |
---|---|---|
committer | Silvan Mosberger <infinisil@icloud.com> | 2018-02-17 15:50:48 +0100 |
commit | c2b8d14b56f70b220b4c7c253036a3b3778a6780 (patch) | |
tree | 825d0e83e452e6a599c9bbfe7574c0f8f811b6dc | |
parent | 588fe10bae7824e1152babe0f9aeba4580cca80b (diff) | |
download | nixlib-c2b8d14b56f70b220b4c7c253036a3b3778a6780.tar nixlib-c2b8d14b56f70b220b4c7c253036a3b3778a6780.tar.gz nixlib-c2b8d14b56f70b220b4c7c253036a3b3778a6780.tar.bz2 nixlib-c2b8d14b56f70b220b4c7c253036a3b3778a6780.tar.lz nixlib-c2b8d14b56f70b220b4c7c253036a3b3778a6780.tar.xz nixlib-c2b8d14b56f70b220b4c7c253036a3b3778a6780.tar.zst nixlib-c2b8d14b56f70b220b4c7c253036a3b3778a6780.zip |
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
-rw-r--r-- | nixos/modules/services/backup/znapzend.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/services/backup/znapzend.nix b/nixos/modules/services/backup/znapzend.nix index 762bb4b38675..3d133f82d204 100644 --- a/nixos/modules/services/backup/znapzend.nix +++ b/nixos/modules/services/backup/znapzend.nix @@ -386,7 +386,7 @@ in echo Resetting znapzend zetups ${pkgs.znapzend}/bin/znapzendzetup list \ | grep -oP '(?<=\*\*\* backup plan: ).*(?= \*\*\*)' \ - | xargs ${pkgs.znapzend}/bin/znapzendzetup delete + | xargs -I{} ${pkgs.znapzend}/bin/znapzendzetup delete "{}" '' + concatStringsSep "\n" (mapAttrsToList (dataset: config: '' echo Importing znapzend zetup ${config} for dataset ${dataset} ${pkgs.znapzend}/bin/znapzendzetup import --write ${dataset} ${config} |