From 6389691be09f19792619085f30678ab8b1ef442b Mon Sep 17 00:00:00 2001 From: Schaller Andreas <150189387+idna38@users.noreply.github.com> Date: Fri, 3 May 2024 16:00:31 +0200 Subject: [PATCH] change find backup procedure for Veeam V12.1 and later (#3214) Running rear recover on different hardware will not show the backups of the original system due to the way how Veeam registers the rescue system as a new client (under the same name, but with different ID). This change handles this situation by searching for all backups for HOSTNAME and selecting the newest one. Searching for HOSTNAME, which is guaranteed to be a short machine name, also to matches the fqdn in case the system is registered in Veeam under the fqdn instead of the short machine name. --- usr/share/rear/restore/VEEAM/default/450_find_backup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/share/rear/restore/VEEAM/default/450_find_backup.sh b/usr/share/rear/restore/VEEAM/default/450_find_backup.sh index 0ed4529b6..2a980a597 100644 --- a/usr/share/rear/restore/VEEAM/default/450_find_backup.sh +++ b/usr/share/rear/restore/VEEAM/default/450_find_backup.sh @@ -12,9 +12,9 @@ LogPrint "Query the latest full backup for Veeam client: $(hostname)" # Linux_FS_nosnap_02 - rhel8-veeam02.lab.quorum.at {27c3120b-ae5f-4086-b508-10c49489c06a} [qlveeam11] Default Backup Repository 2024-01-15 20:59 # Linux_FS_nosnap_02 - rhel8-veeam02.lab.quorum.at {a28896fb-61bc-4ed9-9b30-5801a6eb5698} [qlveeam11] Default Backup Repository 2024-01-15 22:05 -backuplist=$(veeamconfig backup list) || Error "Failed to query backup list" +backuplist=$(veeamconfig backup list --all | grep " - $HOSTNAME") || Error "Failed to query backup list" # search for short HOSTNAME, also to match the fqdn [[ "$backuplist" == *{* ]] || Error "Backup list doesn't contain any backups:$LF$backuplist" -VEEAM_BACKUPID=$(sed -n -e '$s/^.*\({.*}\).*$/\1/p' <<<"$backuplist") # pick backup ID {...} from last line +VEEAM_BACKUPID=$(sed -n -e '$s/^.*\({.*}\).*$/\1/p' <<<"$backuplist") # pick backup ID {...} from last line. We assume that the last line is the most recent backup test "$VEEAM_BACKUPID" || Error "Could not determine backup ID from backup list:$LF$backuplist"