I have seen in several places online that you can set the extended attribute of file or directory to keep it from being backed up. This would be a useful feature for me in preventing various .targets directories in my many Subversion snapshots from being backed up. These .targets directories just hold .o and .a files and are not worth backing up because they are easily regenerated during compile time and do nothing but waste space in a back up.
So anyways as an experiment I set a .targets directory to not back up according to what is claimed online:
Then I went into Time Machine, pointed the window to the right directory, and deleted all backups of .targets. (Note that I set my Finder options to show hidden files). I then performed a Time Machine backup, and the .targets directory still got backed up!
So not only did Time Machine ignore the metadata that I added, but it added its own with respect to backup times.
Can anyone suggest what I might be doing wrong here? Do I have the metadata keywords spelled wrong? Or are the metadata not consulted for hidden files?
I would really like to exclude these directories from backups because they amount to several gigs of constantly changing files that are simply not worth backing up. I was hoping to go the metadata route rather than manually adding these via the Time Machine preferences. I guess I could have a script add them to the com.apple.TimeMachine.plist...
Thanks.
So anyways as an experiment I set a .targets directory to not back up according to what is claimed online:
Code:
% cd /data
% ls -ld .targets
drwxr-xr-x@ 4 jw2002 wheel 136 Sep 29 19:50 .targets
% /usr/bin/xattr -w com.apple.metadata:com_apple_backup_excludeItem com.apple.backupd .targets
% /usr/bin/xattr -l .targets
com.apple.metadata:com_apple_backup_excludeItem: com.apple.backupd
Then I went into Time Machine, pointed the window to the right directory, and deleted all backups of .targets. (Note that I set my Finder options to show hidden files). I then performed a Time Machine backup, and the .targets directory still got backed up!
Code:
% cd "/Volumes/Backup of blort/Backups.backupd/blort/Latest/Macintosh HD/data"
% ls -ld .targets
drwxr-xr-x@ 4 jw2002 wheel 136 Sep 29 19:50 .targets
% xattr -l .targets
com.apple.metadata:_kTimeMachineNewestSnapshot:
0000 62 70 6C 69 73 74 30 30 33 42 2D 63 C3 7F 00 00 bplist003B-c....
0010 00 08 00 00 00 00 00 00 01 01 00 00 00 00 00 00 ................
0020 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0030 00 11 ..
com.apple.metadata:_kTimeMachineOldestSnapshot:
0000 62 70 6C 69 73 74 30 30 33 41 AE B6 F2 9A 00 00 bplist003A......
0010 00 08 00 00 00 00 00 00 01 01 00 00 00 00 00 00 ................
0020 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0030 00 11 ..
com.apple.metadata:com_apple_backup_excludeItem: com.apple.backupd
So not only did Time Machine ignore the metadata that I added, but it added its own with respect to backup times.
Can anyone suggest what I might be doing wrong here? Do I have the metadata keywords spelled wrong? Or are the metadata not consulted for hidden files?
I would really like to exclude these directories from backups because they amount to several gigs of constantly changing files that are simply not worth backing up. I was hoping to go the metadata route rather than manually adding these via the Time Machine preferences. I guess I could have a script add them to the com.apple.TimeMachine.plist...
Thanks.