OS X: Deleting unwanted files from Time Machine

I was a goofball when I installed VirtualBox. I forgot to disable backups of my VM's. Some might want their Virtual Machines backed up, but as they're mostly just test environments, I consider them disposable. Anything important in the VM gets replicated and synced through Subversion.

The problem is when my virtual machines change, Time Machine suddenly tries to back up the entire virtual drive, gobbling as many as a few gigs of data as one file, and seriously cramping my old backups. Once I told Time Machine not to back up the VirtualBox directory, the old backups (hogging many gigs of backup space) remained on my external hard drive. Trying to get rid of them from the command-line wasn't working, as OS X puts some kind of restrictions on the file system.

The filesystem layout is pretty nifty, as shown below:

Chimera:chimera axon$ cd /Volumes/Time\ Machine\ Backups/Backups.backupdb/chimera/
Chimera:chimera axon$ ls -la
total 8
drwxr-xr-x@ 10 root staff 374 Sep 9 22:03 .
drwxr-xr-x+ 3 root staff 102 Jul 29 19:53 ..
drwxr-xr-x@ 3 root staff 204 Jul 5 18:52 2008-07-05-185224
drwxr-xr-x@ 3 root staff 204 Jul 29 22:00 2008-07-29-220053
drwxr-xr-x@ 3 root staff 204 Aug 5 21:50 2008-08-05-215007
drwxr-xr-x@ 3 root staff 204 Aug 30 16:53 2008-08-30-165311
drwxr-xr-x@ 3 root staff 204 Sep 5 23:26 2008-09-05-232659
drwxr-xr-x@ 3 root staff 204 Sep 6 11:42 2008-09-06-114242
drwxr-xr-x@ 3 root staff 204 Sep 6 21:38 2008-09-06-213829
drwxr-xr-x@ 3 root staff 204 Sep 9 22:03 2008-09-09-220316
lrwxr-xr-x 1 root staff 17 Sep 9 22:03 Latest -> 2008-09-09-220316

We won't get too deep into that, though, because it doesn't matter. The answer, oddly, was staring me right in the face... in the graphical Interface... The "Delete All Backups" option shows up under the gear menu, but only when you're browsing your time machine backups.

Obviously, this applies to questionable content and anything else you may have inadvertently backed up, which you no longer wish to be visible through Time Machine.  Keep in mind that forensic eyes can probably see it anyway, and that erasing evidence might be just as good as admitting guilt.

I'm sure there's some way to delete the files manually via the command-line. I'm sure the problems I encountered using "sudo rm [file]" could have been resolved (for example, via xattr), but in the interest of NOT corrupting all of my backups, I guess the GUI will have to suffice for now.

blog comments powered by Disqus