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

Add exclude_by_attribute preference to exclude files based on xattr #498

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
1 participant
@plasticrake
Copy link
Contributor

plasticrake commented Sep 22, 2018

Add preference exclude_by_attribute (boolean). If true:

  • macOS: will exclude all files that have xattr com.apple.metadata:com_apple_backup_excludeItem that contain the value com.apple.backupd.
  • Linux: will excluded all files that have xattr dulicacy_exclude.

Tests Included, tested on macOS afps and Debian ext4

Fixes #478

I named the preference "exclude_by_attribute" and not "exclude_attribute" to make it clear this doesn't affect the storage of attributes on the files.
Alternatively this could be named something like "file_exclude_attribute"

Discussion:

  • Reading Attributes
    • I see that attributes are not always read based on backups size and DUPLICACY_ATTRIBUTE_THRESHOLD. I didn't change the existing code to force a read of the attributes when this occurs. However I think that if exclude_by_attribute is true that it should read the attributes and discard them at least (or call xattr.Getxattr directly on the file if discardAttributes is true). Based on input I can update the pull request.
  • Configurable Attributes
    • I started building out other preferences to make this configurable and possibly support multiple attributes. However I was hesitant to add event more new preferences and adding more parameters to ListEntries(). I can update the pull request with input on design if requested. I think the best design would be to change the bool into a map[string]string like the Keys preference. Based on input I can update the pull request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment