Skip to content

Instantly share code, notes, and snippets.

@ssp
Forked from nriley/tmstop.sh
Created February 15, 2010 09:53
Show Gist options
  • Save ssp/304519 to your computer and use it in GitHub Desktop.
Save ssp/304519 to your computer and use it in GitHub Desktop.
#!/bin/zsh -ef
# Stop Time Machine & AppleFileServer
export PATH=/bin:/usr/bin:/usr/sbin:/usr/libexec
setopt extendedglob
diskutil mount $(diskutil list | awk '/MaryBackup\+ A/ { print $NF }')
[[ $(id -u) == 0 ]] || { print "$0: must be running as root" >&2 ; exit 1 }
# disable AppleFileServer
if launchctl list com.apple.AppleFileServer >& /dev/null ; then
launchctl unload /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist
fi
# disable backupd
defaults write /Library/Preferences/com.apple.TimeMachine AutoBackup -bool NO
# wait for backupd to stop
while launchctl list com.apple.backupd | grep -q 'com.apple.backupd-status'; do
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment