Recently I linked to Nick Schmidt’s piece on using ControlPlane to switch Time Machine profiles (http://geekyschmidt.com/2011/12/29/dual-time-machine-wielding-backups). There was one thing that Nick missed that is important on the OS X side and that is that tmutil may require you to use sudo in order to use the tmutil setdestination command. ControlPlane doesn’t currently allow you to directly call tmutil with administrative privileges. To get around this you can change how sudo is configured on your system so that the tmutil command can be run with administrative privileges and not require a password to do so.
First, open a terminal window and issue the following command
Visudo opens the sudo config file in the vim text editor. If you’re not familiar with vim, I’ll explain in detail how to edit the file so that tmutil can be run without a password.
- Use the arrow keys to find this line
%admin ALL=(ALL) ALL
- Press and hold shift, and then a, release shift. This will put your curser at the end of the line. Add the following:
, NOPASSWD: /usr/bin/tmutil
- The line should now look like this:
%admin ALL=(ALL) ALL, NOPASSWD: /usr/bin/tmutil
- Press escape and type the following:
- Press enter.
That’s it. ControlPlane will now be able to run sudo tmutil without requiring your password each time.