Last active
September 1, 2021 17:45
-
-
Save neilmartin83/5f1b9ec58071243b63e0829d0830b659 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Disables Time Machine and removes all destination set for this Mac | |
/bin/echo "Stopping Time Machine backup if running..." | |
/usr/bin/tmutil stopbackup | |
/bin/echo | |
/bin/echo "Time Machine Destination(s) Found:" | |
/usr/bin/tmutil destinationinfo | |
/bin/echo | |
/bin/echo "Begin removing destinations..." | |
destinationids=($(/usr/bin/tmutil destinationinfo | awk -F': ' '/^ID/ {print $2}')) | |
for id in "${destinationids[@]}" | |
do | |
/bin/echo "Removing destination ID: ${id}" | |
/usr/bin/tmutil removedestination "${id}" | |
done | |
/bin/echo | |
/bin/echo "Disabling Time Machine..." | |
/usr/bin/tmutil disable | |
/bin/echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment