{"id":83,"date":"2008-07-07T18:55:18","date_gmt":"2008-07-07T23:55:18","guid":{"rendered":"http:\/\/vgable.com\/blog\/2008\/07\/07\/programatically-excluding-things-from-time-machine-backups\/"},"modified":"2008-07-07T18:55:20","modified_gmt":"2008-07-07T23:55:20","slug":"programatically-excluding-things-from-time-machine-backups","status":"publish","type":"post","link":"https:\/\/vgable.com\/blog\/2008\/07\/07\/programatically-excluding-things-from-time-machine-backups\/","title":{"rendered":"Programatically Excluding Things from Time Machine Backups"},"content":{"rendered":"<p>To exclude files\/folders from a Time Machine backup, you can use the C-function <a href=\"http:\/\/developer.apple.com\/documentation\/MacOSX\/Reference\/Backup\/Reference\/reference.html\"><code>CSBackupSetItemExcluded()<\/code><\/a>.<\/p>\n<p>As far as I know there isn&#8217;t an <em>official<\/em> way to do this from the command-line or a shell script.  As near as I can tell, the <em>safest<\/em> way to it without using compiled C-code is:<\/p>\n<p><code>sudo defaults write \/Library\/Preferences\/com.apple.TimeMachine \\<br \/>\nSkipPaths -array-add \"PATH-ONE\" \"PATH-TWO\"<\/code><br \/>\nwhere <code>\"PATH-ONE\" \"PATH-TWO\"<\/code> are of course paths to items you want to exclude.<\/p>\n<p>Credit to <a href=\"http:\/\/www.makemacwork.com\/\">Ellis Jordan Bojar<\/a> for this solution. (<a href=\"http:\/\/www.makemacwork.com\/command-time-machine.htm\">original article<\/a>)  Using <code><a href=\"http:\/\/developer.apple.com\/documentation\/Darwin\/Reference\/ManPages\/man1\/defaults.1.html\">defaults<\/a><\/code> instead of tinkering with .plist files directly is really the way to go!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To exclude files\/folders from a Time Machine backup, you can use the C-function CSBackupSetItemExcluded(). As far as I know there isn&#8217;t an official way to do this from the command-line or a shell script. As near as I can tell, the safest way to it without using compiled C-code is: sudo defaults write \/Library\/Preferences\/com.apple.TimeMachine \\ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,3,5,4,9],"tags":[86,87,85],"class_list":["post-83","post","type-post","status-publish","format-standard","hentry","category-cocoa","category-macosx","category-objective-c","category-programming","category-unix","tag-command-line","tag-leopard","tag-time-machine"],"_links":{"self":[{"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/posts\/83","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/comments?post=83"}],"version-history":[{"count":0,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/posts\/83\/revisions"}],"wp:attachment":[{"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/media?parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/categories?post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/tags?post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}