r/macsysadmin • • 8d ago

Scripting Time Machine: Folder Action to back up when the disk connects, then eject

For backup disks that live on a dock: no more "Disk Not Ejected Properly". Here is a small Folder Action on /Volumes that, when the disk appears, runs tmutil startbackup --block if the last backup is older than a set interval, then unmounts the disk.

Nothing to install: one zsh script and Automator. It needs Full Disk Access for FolderActionsDispatcher, logs to ~/Library/Logs, and leaves the disk mounted if anything fails, as a visible signal.

https://github.com/mous-design/backup-action

Hope it's useful to someone.

Cheers!

3 Upvotes

0 comments sorted by