4

I'm having problems clearing our a backup drive. I want to get rid of a couple large files so I can preserve the other incremental backups.

I can't use the tmutil delete command on entire backups since I'd lose all files from that interval and not just the offending file I want to purge. Additionally, having a script would mean I could recover space from a whole lab's worth of computers by scripting this from the command line. I also expect that script would let me discover which file in the package the GUI is refusing to prune since I can debug a script easier than I can Finder and the Time Machine interface.

In case this is a simple permissions issue - the library package file/folder:

Mac:~ bmike$ ls -laeO  /Volumes/Backups/Backups.backupdb/Mac/2015-04-09-072338/Macintosh\ HD/Users/bmike/Pictures/Photos\ Library.photoslibrary 
total 0
drwxr-xr-x@ 10 bmike staff  - 340 Apr  8 20:05 .
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown
drwx------@ 28 bmike staff  - 952 Apr  9 09:38 ..
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown
 1: group:everyone deny delete
drwxr-xr-x+  2 bmike staff  -  68 Apr  8 09:07 Attachments
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown
drwxr-xr-x+  2 bmike staff  -  68 Apr  8 09:07 Masks
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown

When I use the Time Machine interface, it errors out and I don't know which file or instance has errors:

unhelpful finder error

I'm looking for a way to delete these protected files from all backup intervals in a similar manner to the Finder Gear icon action of Delete All Backups of "Photos Library"

Delete All Backups of "Photos Library"

Is this selective pruning of a file/folder possible across all time intervals with Apple's built in tools, a custom script and/or other tool?

  • I get the feeling I'm going to have to program this in python - but I'm hopeful someone else has seen or made such a tool already. – bmike Apr 9 '15 at 17:13
  • Are you saying that when you try to delete the file within TM app, you get that error message? You should be able to Delete All Backups of any file. – benwiggy Mar 10 at 19:51
  • On that machine - no - we get an error. I put a bounty since I have a more general reason to want a script of some sort. JavaScript / python / bash / swift to automate this. Think of 2,000 Macs in an enterprise all with backups of Outlook databases that I would script a cleanup these now that we are backing up email another manner. It will be useful for me on a personal scale as well, but the end goal is to deploy a script across many computers once we're done testing it. @benwiggy Great clarification question. – bmike Mar 10 at 19:55
  • You do know that TimeMachine only keeps copies when the files has changed. If you have a large file and it hasn't changed, you will only have one copy of the file on the drive. I know that parallels app, let's you not save it's large files. – historystamp Mar 10 at 21:29
  • @historystamp Of course, but when you delete one instance of that file, you still end up with n-1 copied of the hard link. I want to delete all 99 versions of said file (or however many copies exist on how many existing intervals). This is trivial on the live file system, protected once the permissions are changed in the backup store. – bmike Mar 10 at 22:05
-1

Here is a way to exclude folders from timemachine.

Hold the command key and type the space bar to bring up Spotlight.

Type Time Machine and open the system preference (not the application).

Click the Options... button in the lower right corner of the Time Machine system preference panel.

Click the plus button then navigate to the folder you want to exclude.

Click on the Exclude button.

Click on Save.

https://www.imore.com/how-exclude-files-time-machine-backups

  • This is correct in the general sense, but doesn’t address deleting the files after they have been backed up. The crux of my question is deleting something that’s already protected and exists only on the backup volume. I appreciate the effort to help, though. I don’t see any way this answer can prune pre-existing backups per the title of the question, so I am going to -1 it. – bmike Mar 10 at 22:03
  • Your just going to get more of them unless you stop them at the source. This is why I thought it relevant. – historystamp Mar 11 at 3:48
  • 1
    Agreed. We've already stopped it. Now we're trying to clean up without losing all the history of all the other files. Basically I want to automate all the clocks to get into time machine and remove one specific folder across several machines. – bmike Mar 11 at 22:48
  • It looks like I can use this answer to solve this at long last - apple.stackexchange.com/questions/333767/… – bmike Apr 20 at 12:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .