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
excluding $RECYCLE.BIN with an exclude file doesn't work #2765
Comments
Not sure about See: https://restic.readthedocs.io/en/latest/040_backup.html#excluding-files |
Well, thanks, it seems that I did overlook exactly this single paragraph in the documentation. It does seem to work out:
and issuing
as expected. However, in now over 10 years of Linux experience I never encountered having to escape a However,
which seems to be quite inconsistent and counter-intuitive. |
The double quotes in (E.g. look at |
@kontakm The issue looks like it's resolved to me. Please close it if that's the case. |
Output of
restic version
restic 0.9.6 (v0.9.6-0-gb723ca3d) compiled with go1.10.4 on linux/amd64
How did you run restic exactly?
I have an NTFS partition shared between a dual-boot Windows 10 and Ubuntu 18.04, which I backup with restic from Ubuntu. As you probably know, Windows 10 creates a directory
$RECYCLE.BIN
in the root directory of the partition to hold files that are moved to the recycle bin. I do want to backup the shared partition, but not the$RECYCLE.BIN
directory.Further below I have provided a detailed description on how to reproduce what I am observing. Long story short: Using
--exclude="\$RECYCLE.BIN"
with the backup command does exclude the directory, putting "$RECYCLE.BIN" (or any other variant I could come up with, see below) into an--exclude-file
does not exclude the directory.What backend/server/service did you use to store the repository?
I observe the behavior both with a local repository (under Ubuntu 18.04) and with a remote repository via SFTP (backup run also on Ubuntu 18.04).
Expected behavior
The folder
$RECYCLE.BIN
is excluded from the backup when added to an exclude file.Actual behavior
The folder
$RECYCLE.BIN
is included in the backup although added to an exclude file.Steps to reproduce the behavior
Inside a temporary test directory, issue the following commands in a bash:
Now issuing
restic --repo=repo/ backup --verbose --verbose data/
yields:as expected.
Issuing
restic --repo=repo/ backup --verbose --verbose --exclude="\$RECYCLE.BIN" data/
yieldswhich is also expected.
However, issuing
restic --repo=repo/ backup --verbose --verbose --exclude-file=exclude.file data/
, whereresults in
That is, the directory is not excluded from the backup although it is present in the exclude file.
I did also try different variants of the exclude file (escaping the dollar sign, adding quotes, adding a newline at the end of the file), but nothing made restic to exclude the directory.
Do you have any idea what may have caused this?
I assume that there must be some error when dealing with file names from an exclude file that involve nasty characters (like the dollar sign).
Do you have an idea how to solve the issue?
Unfortunately, I have no clue about go (I'm only fluent in C++), but there must be something wrong in the interaction with the OS and/or the filesystem when dealing with file names including strange characters.
Did restic help you today? Did it make you happy in any way?
I use restic extensively both for local and remote backups. Keep up the good work!
If I can be of any additional help in resolving this issue, let me know.
The text was updated successfully, but these errors were encountered: