framps / raspiBackup

Create and keep multiple backup versions of your running Raspberries
https://raspibackup.linux-tips-and-tricks.de
GNU General Public License v3.0
821 stars 75 forks source link

Restore of an rsync backup fails when using '-v' (Fix is provided) #781

Closed rpi-simonz closed 2 months ago

rpi-simonz commented 2 months ago

When using option '-v' on a restore rsync fails with

--- RBK0053I: Erste Partition (Bootpartition) wird auf /dev/sda1 zurückgespielt.
--- RBK0055I: Zweite Partition (Rootpartition) wird auf /dev/sda2 zurückgespielt.
rsync: --delete-v: unknown option
rsync error: syntax or usage error (code 1) at main.c(1795) [client=3.2.7]
??? RBK0035E: Backupprogramm rsync endete beim Restore mit RC 1.

Reason:

In function restore() there is a space character missing (last line here):

                                $BACKUPTYPE_RSYNC)
                                        local excludePattern="--exclude=/$HOSTNAME-backup.*"
                                        logItem "Excluding excludePattern"
                                        local progressFlag=""
                                        (( $PROGRESS && $INTERACTIVE )) && progressFlag="--info=progress2"
                                        local cmd="rsync $progressFlag --numeric-ids ${RSYNC_BACKUP_OPTIONS}${verbose} ${RSYNC_BACKUP_ADDITIONAL_OPTIONS} $excludePattern \"$ROOT_RESTOREFILE/\" $MNT_POINT"
${RSYNC_BACKUP_OPTIONS}${verbose} 

needs to be

${RSYNC_BACKUP_OPTIONS} ${verbose} 
framps commented 2 months ago

Good catch :+1: Do you want to create a PR on master which I will immediately accept or do you want me to fix this?

rpi-simonz commented 2 months ago

Just do it yourself. It's easier and faster.

framps commented 2 months ago

Just fixed and published. Use sudo raspBackup -U -S to update raspiBackup.