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

backup: add option --exclude to skip matching file paths from bind mounts #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrewleech
Copy link

Closes #18

@@ -178,7 +211,8 @@ func backup(ID string) error {
return err
}

for _, m := range conf.Mounts {
paths = []string{}
Copy link
Owner

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 😃

Copy link
Author

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) {
Copy link
Owner

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.

Copy link
Author

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?

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

Successfully merging this pull request may close these issues.

Excluding mapped system volumes
3 participants