-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
backup: add option --exclude to skip matching file paths from bind mounts #25
base: master
Are you sure you want to change the base?
Conversation
@@ -178,7 +211,8 @@ func backup(ID string) error { | |||
return err | |||
} | |||
|
|||
for _, m := range conf.Mounts { | |||
paths = []string{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure your sources are always gofmt
'd before pushing! It's the best thing since sliced bread, really 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't know about that command - I'll try it out!
if mount.Type == "bind" { | ||
skip := false | ||
for _, exclude := range optExclude { | ||
if strings.HasPrefix(mount.Source, exclude) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a user's perspective, I wonder if we shouldn't support globbing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did wonder about that, either glob or regex. I'm not sure how common that need would be though, to exclude a more complex pattern of files in a bind (rather than entire folders/trees). The question then is, do you match glob/regex against the path to the bind, or individually against all the files searched in the bind?
Closes #18