Fix rsync issues with quotes in remote path #1256
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I recently noticed that my scheduled backups were failing because of a rsync error. Here's the log output:
Just for reference: The SSH server I'm backing up to is a Synology NAS.
The problem is that rsync seems unable to handle the quotes in
Florian@my_server:"backups/backintime/manjaro/florian/1/new_snapshot/backup"
. Removing the quotes resulted in a successful backup again.I don't know whether my local rsync or the remote rsync changed behavior in a newer version. For reference here are the rsync versions I'm using:
local
remote
I assume the purpose of the quotes is to support paths with spaces. So, to achieve the same behavior as before there is the
--protect-args
option in rsync which allows using paths with spaces without having to surround them with additional quotes.This PR adds the
--protect-args
flag to the rsync command and removes all explicit quotes around remote paths.I don't know if changing the default value of the
quote
parameter inrsyncRemotePath
is the preferred solution but it was the easiest for me to do. :DI tested this with my setup using a remote backup path with and without spaces and it worked just as before.
Just FYI: I also found the suggestion that quoting the whole
user@host:path
(i.e."Florian@my_server:backups/backintime/manjaro/florian/1/new_snapshot/backup"
in my case) should work but this didn't seem to be the case here.