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 \
--human-readable \
$hardlinkopt \
--rsh "ssh -p $port" \
- $remote_user@$host:$path \
+ $hostpath \
$backup_path/$machine \
|| errlog "could not backup $machine with path $path" \
|| return $?