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

Non-existent exclude file causes all exclude files to be ignored #1893

Closed
ProactiveServices opened this issue Jul 18, 2018 · 1 comment
Closed
Labels
state: need implementing cause/request established, need work/solution type: bug

Comments

@ProactiveServices
Copy link
Contributor

Output of restic version

restic 0.9.1 compiled with go1.10.3 on windows/amd64

How did you run restic exactly?

restic backup -r restic --exclude-file=exclude1.txt --exclude-file=exclude2.txt source

dir /b source
1.txt
2.txt
3.txt

type exclude1.txt
1.txt

(exclude2.txt does not exist)

restic backup -r restic --exclude-file=exclude1.txt --exclude-file=exclude2.txt source
enter password for repository:
repository 56deafac opened successfully, password is correct
error reading exclude patterns: open exclude2.txt: The system cannot find the fi

Files:           3 new,     0 changed,     0 unmodified
Dirs:            0 new,     0 changed,     0 unmodified
Added:      312 B

processed 3 files, 19 B in 0:02
snapshot 4e07390f saved

restic ls -r restic latest
enter password for repository:
repository 56deafac opened successfully, password is correct
snapshot 4e07390f of [<redacted>\testing\source] at 2018-07-18 19:25:40.5134941 +0100 BST):
/source
/source/1.txt
/source/2.txt
/source/3.txt

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

Local

Expected behavior

Only 1.txt to be backed up.

Actual behavior

1.txt, 2.txt and 3.txt backed up

Steps to reproduce the behavior

Run a restic backup with a valid exclude file. List files in the repo, observe files are correctly excluded.
Add a file to the source that would be excluded by the exclude file patterns.
Run a restic backup and add an additional exclude file switch using a file name that does not exist. Observe that all exclude files are ignored. --exclude switches are accepted.

Do you have any idea what may have caused this?

I think

opts.Excludes = append(opts.Excludes, readExcludePatternsFromFiles(opts.ExcludeFiles)...)
may need a try/catch clause. I'm not a competent programmer so I'll leave it to someone more experienced.

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

It' will do when I get as far as implementing it for my customers and myself \o/

@fd0 fd0 added the type: bug label Jul 18, 2018
@fd0
Copy link
Member

fd0 commented Jul 18, 2018

Whoops, this is a bug, thanks for the report! I'll have a look now.

@fd0 fd0 added the state: need implementing cause/request established, need work/solution label Jul 18, 2018
@fd0 fd0 closed this as completed in #1894 Jul 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: need implementing cause/request established, need work/solution type: bug
Projects
None yet
Development

No branches or pull requests

2 participants