Skip to content

Commit

Permalink
change find backup procedure for Veeam V12.1 and later (#3214)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
idna38 committed May 3, 2024
1 parent e630ec5 commit 6389691
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions usr/share/rear/restore/VEEAM/default/450_find_backup.sh
Expand Up @@ -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"

0 comments on commit 6389691

Please sign in to comment.