From 1c185e054360f1861b8b15a2f90f318698b4ca1a Mon Sep 17 00:00:00 2001 From: admin666 Date: Wed, 22 Nov 2023 10:53:03 +0100 Subject: [PATCH] Ajout d'options pour rsync --- restore.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/restore.sh b/restore.sh index 9b09422..f3938ac 100755 --- a/restore.sh +++ b/restore.sh @@ -41,10 +41,11 @@ function clean_exit() { vm=$1 dest=$2 backuphost=$3 +rsync_options=$4 generic_image="/srv/vmverse/installation/generic.a-lec.org.raw" -if [[ $# != 3 ]] +if [[ $# < 3 ]] then echo "ERROR: 3 parameters required : vm domain, destination path, backup host" exit 1 @@ -92,7 +93,7 @@ borg mount root@${backuphost}:/var/backups/borg/${vm}.repo::${DATES[backupdate]} # Syncing echo "Syncing now !" sleep 1 -rsync -ar --info=progress2 --no-i-r --sparse /mnt/${vm}-remote/. /mnt/${vm} +rsync -ar --info=progress2 --no-i-r --sparse ${rsync_options} /mnt/${vm}-remote/. /mnt/${vm} # Cleaning up echo -e "\nOK\n"