fix case when we have multiple backup destinations
This commit is contained in:
@@ -90,17 +90,19 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.jq ];
|
||||||
|
|
||||||
clanCore.backups.providers.borgbackup = {
|
clanCore.backups.providers.borgbackup = {
|
||||||
# TODO list needs to run locally or on the remote machine
|
# TODO list needs to run locally or on the remote machine
|
||||||
|
|
||||||
list = ''
|
list = ''
|
||||||
set -efu
|
set -efu
|
||||||
# we need yes here to skip the changed url verification
|
# we need yes here to skip the changed url verification
|
||||||
${lib.concatMapStringsSep "\n" (
|
${
|
||||||
dest: ''
|
lib.concatMapStringsSep "\\\n" (
|
||||||
yes y | borg-job-${dest.name} list --json | jq '{"backups": [.archives[] | {"name": ("${dest.repo}::" + .name), "job_name": "${dest.name}"}]}'
|
dest:
|
||||||
''
|
''yes y | borg-job-${dest.name} list --json | jq '[.archives[] | {"name": ("${dest.repo}::" + .name), "job_name": "${dest.name}"}]' ''
|
||||||
) (lib.attrValues cfg.destinations)}
|
) (lib.attrValues cfg.destinations)
|
||||||
|
} | jq -s 'add'
|
||||||
'';
|
'';
|
||||||
create = ''
|
create = ''
|
||||||
${lib.concatMapStringsSep "\n" (dest: ''
|
${lib.concatMapStringsSep "\n" (dest: ''
|
||||||
|
|||||||
Reference in New Issue
Block a user