Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Operations 3 min read

Simplify macOS Time Machine Cleanup with the Interactive tm-cleanup.sh Script

This article introduces tm-cleanup.sh, a shell script that automates Time Machine backup removal on macOS, now featuring an interactive, dialog‑based interface that lets users browse and delete snapshots without needing command‑line expertise.

About two years ago I created a shell script called tm-cleanup.sh to automate the cleanup of macOS Time Machine backups, handling timestamps and other details. The script proved very useful and saved a lot of time.

Because some non‑technical users encountered difficulties running the script from the CLI, I added an interactive, dialog‑based interface to make the process visual and user‑friendly.

The new version 2.0 can be launched simply with the following command: $ sudo tm-cleanup.sh The script takes no arguments. The interactive menu displays a list of existing Time Machine snapshots, allowing users to select and delete individual backups.

Below is a screenshot of the backup list interface:

Time Machine backup list screenshot
Time Machine backup list screenshot

For more details and documentation, visit the GitHub repository at https://github.com/emcrisostomo/Time-Machine-Cleanup .

Author: Enrico Maria Crisostomo Translator: 21CTO Community Original article: https://dzone.com/articles/tm-cleanupsh-a-shell-script-now-featuring-an-inter
About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

interactiveAutomationmacOSshell scriptbackup cleanuptime machine

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion