Skip to content
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

Exclude folders from backups on Windows - unclear how to achieve - example / documentation update suggested #1874

Closed
tomwaldnz opened this issue Jul 3, 2018 · 2 comments

Comments

@tomwaldnz
Copy link

tomwaldnz commented Jul 3, 2018

I'm trying to exclude a subfolder and all its contents using Restic on Windows.

There's a lot of examples in bug 1005, but it's still not clear how to exclude folders specified as full path names. A few more examples in the documentation would be really helpful..

For example, say I'm backing up c:\documents\financials and I want to exclude all files in c:\documents\financials\temporary, how do I do that?

I've tried the command lines below and a few more variations, but the contents of temporary are still included in the backup.

Output of restic version

restic 0.9.1 compiled with go1.10.3 on windows/amd64

How did you run restic exactly?

restic_0.9.1_windows_amd64.exe --exclude='temporary' -r C:\repo backup c:\documents\financials
restic_0.9.1_windows_amd64.exe --excludefile='temporary' -r C:\repo backup c:\documents\financials
restic_0.9.1_windows_amd64.exe --exclude='c:\documents\financials\temporary' -r C:\repo backup
restic_0.9.1_windows_amd64.exe --exclude='c:\documents\financials\temporary*' -r C:\repo backup c:\documents\financials
restic_0.9.1_windows_amd64.exe --exclude='c:\documents\financials\temporary\*' -r C:\repo backup c:\documents\financials
restic_0.9.1_windows_amd64.exe --exclude='c:\documents\financials\temporary' -r C:\repo backup c:\documents\financials
restic_0.9.1_windows_amd64.exe --exclude='temporary' -r C:\repo backup c:\documents\financials
restic_0.9.1_windows_amd64.exe --exclude='/C/documents/financials/temporary/' -r C:\repo backup c:\documents\financials

What backend/server/service did you use to store the repository?

Windows local file system

Expected behavior

Folder c:\documents\financials\temporary\ should be excluded from backup

Actual behavior

Folder contents are included in backup

Steps to reproduce the behavior

As above.

Do you have any idea what may have caused this?

N/A

Do you have an idea how to solve the issue?

Turns out the answer was RTFM.

Did restic help you or made you happy in any way?

It might if I can get it to work as desired :) Looks like a nice backup program, cross platform, mature and reliable, so I'm trying it out on my Linux and Windows systems.

@tomwaldnz
Copy link
Author

I worked it out - it's a PEBKAC error. I didn't read the documentation properly and my command line was malformed. I had used

--exclude="c:\path\to\file"

when I needed to use

--exclude "c:\path\to\file"

Note the lack of an equals sign. Solved!

@ProactiveServices
Copy link
Contributor

restic supports both a = and a space between the switch name and its value. Having just run a test using 0.9.1 it correctly excludes when using --exclude=pattern and --exclude pattern.
You may have been caught out by the fact restic is case-sensitive - something us Windows users often overlook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants