Does anyone have a macro for Toggling Time Machine backups on and off in macOS Ventura? I had an AppleScript that did this in Monterey, but Apple changed the interface and this no longer works. Instead, you have to switch the backup frequency to Manual.
I have a macro that turns the frequency to “Manual,” but it won't work to turn it back on to “Automatically every hour.” I think I need an If/Then statement to check Time Machine's current backup frequency.
Does anyone know how to do this?
@ccstone - tagging you here in case you know. Thanks.
Echoing @mrpasini, you're better off doing this via an "Execute Shell Script" action.
You'll need to do some setup first -- enabling and disabling Time Machine via tmutil requires sudo so you'll have to allow those commands to be executed without requiring a password. Open Terminal. Type in whoami, hit Return, and copy the text returned -- your short username.
Still in Terminal, type sudo visudo /private/etc/sudoers.d/tmutil and hit Return -- enter your password if asked. Type i to enter interactive mode then ⌘V to paste in your short username, a space, then ALL=NOPASSWD: /usr/bin/tmutil enable, /usr/bin/tmutil disable, !/usr/bin/tmutil enable *, !/usr/bin/tmutil disable *. Press the esc key then type :wq and hit Return to write-and-quit.
You can then use the following in an "Execute Shell Script" action:
#!/bin/bash
if [ $(/usr/bin/defaults read /Library/Preferences/com.apple.TimeMachine.plist AutoBackup) == 1 ]; then
sudo /usr/bin/tmutil disable;
else
sudo /usr/bin/tmutil enable;
fi
...to toggle Time Machine. And the macro can be as simple as