Skip to main content
Solved

tmutil setdestination to Multiple Destinations

  • May 18, 2016
  • 2 replies
  • 31 views

gskibum
Forum|alt.badge.img+13

Has anyone been able to write a script using tmutil to set more than one destination?

For example I would like to set either two network destinations or a single network destination and a local HD.

I've got this script running for a single destination, but when I try and modify it to set multiple destinations things don't work.

If I try two scripts one will simply overwrite the other.

Is setting multiple destinations even possible with the current tmutil?

#!/bin/sh

TimeMachineDestination="afp://username:password@server.pretendco.com/Backups"

echo "Setting Time Machine Destination"

/usr/bin/tmutil setdestination $TimeMachineDestination

echo "Enabling Time Machine"

/usr/bin/tmutil enable

exit 0

Best answer by aaronf

Try the -a flag to set the 2nd destination.

#!/bin/sh

TimeMachineDestination1="afp://username:password@server1.pretendco.com/Backups"
TimeMachineDestination2="afp://username:password@server2.pretendco.com/Backups"

echo "Setting Time Machine Destination"

/usr/bin/tmutil setdestination $TimeMachineDestination1
/usr/bin/tmutil setdestination -a $TimeMachineDestination2

echo "Enabling Time Machine"

/usr/bin/tmutil enable

exit 0

2 replies

Forum|alt.badge.img+7
  • New Contributor
  • Answer
  • May 19, 2016

Try the -a flag to set the 2nd destination.

#!/bin/sh

TimeMachineDestination1="afp://username:password@server1.pretendco.com/Backups"
TimeMachineDestination2="afp://username:password@server2.pretendco.com/Backups"

echo "Setting Time Machine Destination"

/usr/bin/tmutil setdestination $TimeMachineDestination1
/usr/bin/tmutil setdestination -a $TimeMachineDestination2

echo "Enabling Time Machine"

/usr/bin/tmutil enable

exit 0

gskibum
Forum|alt.badge.img+13
  • Author
  • Valued Contributor
  • August 4, 2016

Major edit:

Ugh it helps if one uses the -a argument in the right place. ;-)