forked from clan/clan-core
backups: fix name extraction for borgbackup restore
This commit is contained in:
parent
539df08706
commit
82507a975a
@ -112,11 +112,12 @@ in
|
|||||||
cd /
|
cd /
|
||||||
IFS=';' read -ra FOLDER <<< "$FOLDERS"
|
IFS=';' read -ra FOLDER <<< "$FOLDERS"
|
||||||
job_name=$(echo "$NAME" | ${pkgs.gawk}/bin/awk -F'::' '{print $1}')
|
job_name=$(echo "$NAME" | ${pkgs.gawk}/bin/awk -F'::' '{print $1}')
|
||||||
|
backup_name=''${NAME#"$job_name"::}
|
||||||
if ! command -v borg-job-"$job_name" &> /dev/null; then
|
if ! command -v borg-job-"$job_name" &> /dev/null; then
|
||||||
echo "borg-job-$job_name not found: Backup name is invalid" >&2
|
echo "borg-job-$job_name not found: Backup name is invalid" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
yes y | borg-job-"$job_name" extract --list "$NAME" "''${FOLDER[@]}"
|
yes y | borg-job-"$job_name" extract --list "$backup_name" "''${FOLDER[@]}"
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user