Mac – Deleting all but the most recent Time Machine backup

backupmigrationtime-machine

I just bought a new Mac and I'm manually migrating everything over given that it's been a while since I did a clean install and that the new Mac has less storage than my existing one. I will be wiping the old Mac after I do the migration.

However, I have about 600GB worth of Time Machine backups for the old Mac on the NAS which I'd like to shrink to make space for Time Machine on the new Mac. I just want the latest Time Machine backup to serve as an archive in case I forget to move some files when I wipe the old Mac.

Is it possible to (easily) delete all but the latest snapshot of the Time Machine backup?

Thanks

Best Answer

Assuming OSX 10.8 or later, you could use a combination of find and tmutil

tmutil delete <path> will remove the snapshot at <path>

while

find /path/to/backups/ -maxdepth 1 will list all of your backup snapshots. The last one ( Latest ) is a link to the latest one. You can be a little creative and use find /path/to/backups -name 2\* -maxdepth 1 to list only the "real" directories (all the dates which start with 2014, etc). And, finally, (thanks to this link) you can get a list of all but the last snapshot:

find /path/to/backups -name 2\* -maxdepth 1 | sed \$d