-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backing up files with spaces in them with --files-from argument #1590
Comments
I ran a very simple test case to a local repo where I attempted to back up a single directory with an embedded space, specifically: /home/testrestic/test dir Placing various quoted variations of this directory in my --files-from file failed just as it did in your example. However, including the line exactly as written above (space and all) succeeded. From this test, it appears that quoting of spaces is not required. This seems odd (not at all what I would have expected), but since it worked in my simple test case, you might want to give it a try and report back. |
Thanks. I did try this, and then went to trying out various quoting options when it did not work. I took another look upon getting your reply, and it turns out I had a space at the end of that line (referenced by --files-from). Live by the not quoting, die by the not quoting, I suppose Thanks again |
That's an interesting failure case. For |
FWIW, the required syntax for "--files-from" files and "--exclude-file" files appears to be different. "--files-from" entries work as described above. "--exclude-files" entries appear to require quoted special characters (blanks in particular). I'm only now trying to learn to read Go (I'm a slow learner!) so not clear to me why this is. |
Oh, good point, that's an issue. For |
In #1590, it was mentioned that while lines read from exclude files via `--exclude-file` have leading and trailing spaces stripped, this is not the case for lines read via `--files-from`. This commit fixes that, spaces are always stripped.
Output of
restic version
restic 0.8.1
compiled with go1.9.2 on linux/amd64
How did you run restic exactly?
/usr/local/lib/restic_0.8.1_linux_amd64 backup --password-file=/usr/local/etc/chbackup/private/chbackup-passwd --repo=b2:xxx --files-from=/usr/local/etc/chbackup/dirs.conf --exclude-file=/usr/local/etc/chbackup/exceptions.conf --hostname=xxx --tag=system
What backend/server/service did you use to store the repository?
B2, but I don't think it matters
Expected behavior
I would like to be able to back up files and directories with spaces in the name
Actual behavior
/'a\ b' does not exist, skipping
/a\ b does not exist, skipping
/'a b' does not exist, skipping
Steps to reproduce the behavior
Just have a directory with a space in the name in a file referenced by the files-from argument. I tried
Do you have any idea what may have caused this?
Do you have an idea how to solve the issue?
I tried various quoting methods with no joy
Did restic help you or made you happy in any way?
I do love restic, but do need to be able to back up such files
The text was updated successfully, but these errors were encountered: