]> gitweb.hhaalo.de Git - simple-backup.git/commitdiff
add hostpath with localhost
authorBastian Dehn <hhaalo@arcor.de>
Tue, 19 May 2026 15:22:37 +0000 (17:22 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 19 May 2026 16:31:56 +0000 (18:31 +0200)
src/backup

index 638048108325ad9b8f9c87810e27bd49f9891ca4..6ffe60324e1d81d4271027b433e7db4f91466299 100755 (executable)
@@ -139,7 +139,10 @@ backup_remote_pathes()
                printf "path ${YELLOW}%s${RESET}\n\n" "$path"
 
                [ -n "$last_backup_dir_path" ] \
-                       && hardlinkopt="--link-dest=$last_backup_dir_path/$machine"
+                       && local hardlinkopt="--link-dest=$last_backup_dir_path/$machine"
+
+               local hostpath="$remote_user@$host:$path"
+               [ "$host" == "localhost" ] && local hostpath="$path"
 
                rsync --archive \
                        --verbose \
@@ -150,7 +153,7 @@ backup_remote_pathes()
                        --human-readable \
                        $hardlinkopt \
                        --rsh "ssh -p $port" \
-                       $remote_user@$host:$path \
+                       $hostpath \
                        $backup_path/$machine \
                        || errlog "could not backup $machine with path $path" \
                        || return $?