-
Notifications
You must be signed in to change notification settings - Fork 338
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
Excluding updates from backups #118
Comments
From gregnea...@mac.com on February 23, 2012 15:29:59 I don't know how to implement that in Python, either. If you can do this in C, can you check to see if it's as simple as a new extended attribute added to the item? If so, we can do that with xattr... |
From hjuutila...@mac.com on March 01, 2012 05:05:24 Doing a quick test it seems that you can exclude with: Verified with /usr/bin/tmutil |
From gregnea...@mac.com on March 01, 2012 09:19:41
|
From gregnea...@mac.com on March 01, 2012 10:22:46 The value of the attribute when generated by -Greg |
From hjuutila...@mac.com on March 01, 2012 11:46:44 Yes, you're correct. I'm not sure but I think tmutil is Lion only? I don't have any older systems available right now but I'll check the xattr functionality tomorrow with 10.5 and 10.6. systems too. |
From gregnea...@mac.com on March 01, 2012 11:49:20 Yes, tmutil is new in Lion. So to clarify, when you said "Doing a quick test it seems that you can exclude with: How did you come up with that? -Greg |
From hjuutila...@mac.com on March 01, 2012 12:26:53 By some extensive googling :) Took a while but stumbled on this: http://www.entropy.ch/blog/Mac+OS+X/2008/06/14/Exclude-Items-From-Time-Machine-Backup-With-Contextual-Menu.html |
From gregnea...@mac.com on March 01, 2012 12:39:27 I just worry that although sudo xattr -w com.apple.metadata:com_apple_backup_excludeItem com.apple.backupd /Library/Managed\ Installs works now, since it doesn't write the same attribute value as sudo tmutil addexclusion /Library/Managed\ Installs that it might break in the future. |
From hjuutila...@mac.com on March 01, 2012 22:31:56 I'm concerned about this too. Would it be the safest bet to do something like: #!/usr/bin/env python encoding: utf-8import subprocess currentRelease = platform.release() def excludeFromBackups(aPath): def excludeFromBackupsWithXattr(aPath): Mac OS 10.7.xif currentRelease.startswith('11.'): Mac OS 10.6.xelif currentRelease.startswith('10.'): Mac OS 10.5.xelif currentRelease.startswith('9.'): if retcode == 0: |
From gregnea...@mac.com on March 02, 2012 06:55:37 Not bad, though for forward compatibility, maybe something more like: TMUTIL = "/usr/bin/tmutil" -Greg |
From Evi.Vano...@gmail.com on August 21, 2013 15:47:48 The binary vs. non-binary setting is a non-issue. The plist interpreter reads both. If you use MCX you can override settings in plists that are typically in binary with non-binary XML, the plists work the same. You can also convert the binary XML to human-readable XML and vice versa. Apple seems to be going towards the binary XML probably because it is smaller and faster to read/write within the OS but they're both valid XML and will thus be parsed validly. However I do think that using tmutil would be the best option vs xattr just in case that later on Apple decides to change how to exclude items and where to store that metadata. |
Sorry for the necro, but just a huge FYI: the plain string |
This commit closes munki#118 by sticking the xattr on the directory and telling pkgbuild to keep it.
From hjuutila...@mac.com on October 03, 2011 00:25:16
This is just a minor enhancement request...
The contents of /Library/Managed Installs/ should probably be excluded from time machine backups. Apple is already excluding /Library/Updates/ by default (in /System/Library/CoreServices/backupd.bundle/Contents/Resources/StdExclusions.plist) and I think it would be nice for munki to automatically mark files as excluded.
I'm not sure how to implement this in python but in cocoa the way to exclude a path is defined in BackupCore.h and found in CoreServices framework. For example:
NSURL *someURL = [NSURL fileURLWithPath:@"/path/to/file"];
Boolean exclude = TRUE; // exclude item from backups
Boolean excludeByPath = FALSE; // this item is excluded regardless of its location
CSBackupSetItemExcluded((CFURLRef)someURL, exclude, excludeByPath);
Is there something in /Library/Managed Installs/ that needs a backup or should we just exclude the whole directory?
BTW. CrashPlan respects this exclusion too.
Hannes
Original issue: http://code.google.com/p/munki/issues/detail?id=118
The text was updated successfully, but these errors were encountered: