AdSense Mobile Ad

Saturday, May 2, 2015

A Shell Script to Delete Old Time Machine Backups and Free Disk Space

In another post I described the procedure to manually delete Time Machine snapshots and optionally shrink the disk image (in case a sparse bundle is being used) in order to free up disk space.

I have written a shell script, tm-cleanup.sh, to automate the backup deletion. The script accepts an optional argument to specify the maximum backup age in days: older backups are deleted (by default, backups older than 30 days are deleted).

The latest version of the script can be obtained by cloning its GitHub repository and, optionally, run its installation script to create symbolic links to it into /usr/local/bin:

$ sudo make install


3 comments:

Unknown said...

Thanks very much for this. I have been wondering how to free up my TM disk which had over 700mb of backups and was full. I have now recovered over 350mb.

Enrico M. Crisostomo said...

Hi John, I'm really glad it helped!

Anonymous said...

I'm a noob. Funnily enough on my old mac I worked out how to get this to work. Now I can'tremember. Could you do an idiots guide step by step?