Merge pull request 'backups: implement list the easy way' (#617) from lassulus-backups2 into main

This commit is contained in:
clan-bot
2023-12-07 17:25:56 +00:00
4 changed files with 64 additions and 18 deletions

View File

@@ -67,11 +67,11 @@ in
clanCore.backups.providers.borgbackup = {
list = ''
ssh ${config.clan.networking.deploymentAddress} -- '
ssh ${config.clan.networking.deploymentAddress} <<EOF
${lib.concatMapStringsSep "\n" (dest: ''
borg-job-${dest.name} list --json
borg-job-${dest.name} list --json | jq -r '. + {"job-name": "${dest.name}"}'
'') (lib.attrValues cfg.destinations)}
'
EOF
'';
start = ''
ssh ${config.clan.networking.deploymentAddress} -- '
@@ -82,6 +82,11 @@ in
'';
restore = ''
ssh ${config.clan.networking.deploymentAddress} -- LOCATION="$LOCATION" ARCHIVE="$ARCHIVE_ID" JOB="$JOB" '
set -efux
cd /
borg-job-"$JOB" extract --list --dry-run "$LOCATION"::"$ARCHIVE"
'
'';
};
};