Skip to content

Instantly share code, notes, and snippets.

View eirture's full-sized avatar

Jie Liu eirture

  • Qiniu Cloud
  • Hangzhou, China
  • 08:41 (UTC +08:00)
View GitHub Profile
@linjer
linjer / tmcleanup.md
Last active March 31, 2025 17:32
Script to automatically remote old Mac OSX Time Machine Backups older than a specified number of days

Prerequisites

  • 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

Script

  • 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.