I’m using Crashplan to backup a few computers. However, while I’m travelling I don’t want crashplan to suck all my bandwidth. I therefore created a short shell script to start and stop crashplan’s backup when I want to. Here it is.
#!/bin/sh
USER=~/Library/LaunchAgents/com.crashplan.engine.plist
SYSTEM=/Library/LaunchDaemons/com.crashplan.engine.plist
if [ -f $SYSTEM ]
then
PLIST=$SYSTEM
elif [ -f $USER ]
then
PLIST=$USER
else
echo "Unable to find plist file in /Library/LaunchDaemons/ or ~/Library/LaunchAgents/"
echo "Did you install crashplan in some other way?"
exit 1
fi
# see how we were called.
case "$1" in
start)
echo -n "Starting crashplan: "
launchctl load $PLIST
echo
;;
stop)
echo -n "Shutting down crashplan: "
launchctl unload $PLIST
echo
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
25 Jun 2012 Categories: code No comments yet.
Comments are currently closed on this entry.