Skip to content

Instantly share code, notes, and snippets.

@dbremner
Created March 25, 2019 01:22
Show Gist options
  • Save dbremner/e7c9e6891b1c230f08d39b38fdf9fb9a to your computer and use it in GitHub Desktop.
Save dbremner/e7c9e6891b1c230f08d39b38fdf9fb9a to your computer and use it in GitHub Desktop.
Deleting Old Time Machine backups
Problem:
Time Machine backups accumulate until they fill the drive.
Solution:
1. Run "tmutil listbackups" from a shell and pipe the output to a file.
2. Use TextEdit pattern-based search and replace to quote each line of the file.
3. Select a subset of the file with a buffer of several years.
4. Open a terminal and run caffeinate to keep the computer from sleeping.
5. Open an interactive root shell with "sudo -i"
6. Use the following command to delete old backups.
cat /Users/$username/remaining_backups.txt | xargs -n 1 tmutil delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment