Mac – Suppress Time Machine Old Backups Dialogue Via Command Line

backupterminaltime-machine

Instead of letting Time Machine run automatically I use a shell script and the tmutil startbackup command to trigger backups, which gives me a much greater degree of flexibility. Specifically it lets me perform hourly backups to a local drive during my normal hours, with a separate network backup at night (since it tends to be a lot slower).

Unfortunately, I've discovered today that if the network drive is filling up enough that old backups need to be deleted, then the dialogue informing me of this will prevent the backup from proceeding until I hit okay, but since it occurs after I normally leave my computer my machine just ends up staying awake all night waiting for me to do something about it.

What I'd like to do is suppress this dialogue for my overnight backup, but leave it them enabled/re-enable it for my hourly backups. Is there a way I could do this? There doesn't appear to be any capability in tmutil itself. Is there a defaults option I could change perhaps?

Best Answer

I don’t know whether you can suppress the dialog through tmutil directly.

The alternative, as you suggested, is to temporarily turn off the “Notify after old backups are deleted” option of the Time Machine options preferences through defaults:

sudo defaults write /Library/Preferences/com.apple.TimeMachine.plist AlwaysShowDeletedBackupsWarning 0

Use “1” instead of “0” to turn the option back on.

(I should perhaps specify that this answer applies to El Capitan, I don’t know about Sierra, though I assume this hasn’t changed.)