- gfind (via
brew install findutils
)
- Time Machine drive mounted on your computer (or you can change path from standard /Volume/Time\ Machine\ Backups/Backups.backup.db/
- Admin/sudo access in the OSX terminal
- Be sure to set the correct machine name. You can check the actual folder things are going into by looking in the backup location.
- By default, it erases all backups older than 30 days. Adjust as desired.
$ sudo ./tmcleanup.sh
*-* Removing old Time Machine Backups for vitruvius older than 30 days *-*
Deleting: /Volumes/Time Machine Backups/Backups.backupdb/vitruvius/2014-07-21-231955
Deleted (29.7G): /Volumes/Time Machine Backups/Backups.backupdb/vitruvius/2014-07-21-231955
Total deleted: 29.7G
Elapsed time: 2768 secs.
Finished!
use
tmutil machinedirectory
command can simplify logic