MacNN Forums (http://forums.macnn.com/)
-   Mac OS X (http://forums.macnn.com/mac-os-x/)
-   -   Time Machine, Multiple Disks, Headless Macs (http://forums.macnn.com/90/mac-os-x/502691/time-machine-multiple-disks-headless-macs/)

 
Waragainstsleep Aug 1, 2013 05:00 AM
Time Machine, Multiple Disks, Headless Macs
I'd like to use a pair of portable USB drives to Time Machine my Mac Mini Server(s) but I need a way to make it safe for someone to pull a drive (during a certain window each day) and connect the other one so that they can always have an offsite backup.

I had an applescript for this but it doesn't seem to work properly any more and since Mountain Lion I can no longer use iCal to schedule it anyway. My script basically just ejected whichever disk was attached at 5pm, then mounted the other one at 6pm so a user could swap them over any time in between without fear of damaging the filesystem or interrupting a backup.

Does anyone have any ideas the best way to do this?
 
P Aug 1, 2013 06:37 AM
Not sure how much you've tried, but if you just make a shell script that will unmount both drives:

umount /Volumes/BackupDrive1
umount /Volumes/BackupDrive2

It will just throw an error for the one that isn't there and keep working. You might have to manually remove the empty directory to make the new drive mount in the same location (rmdir /Volumes/BackupDrive1 in that case). The drives will then automount when a new one is plugged in. This script can be run by launchd, for instance.

http://nathangrigg.net/2012/07/sched...using-launchd/

If you want to have absolute control over where the drives are mounted, you can disable the automounting using /etc/fstab and then mount them manually in the script, but try this first.
 
P Aug 1, 2013 06:37 AM
Not sure how much you've tried, but if you just make a shell script that will unmount both drives:

umount /Volumes/BackupDrive1
umount /Volumes/BackupDrive2

It will just throw an error for the one that isn't there and keep working. You might have to manually remove the empty directory to make the new drive mount in the same location (rmdir /Volumes/BackupDrive1 in that case). The drives will then automount when a new one is plugged in. This script can be run by launchd, for instance.

http://nathangrigg.net/2012/07/sched...using-launchd/

If you want to have absolute control over where the drives are mounted, you can disable the automounting using /etc/fstab and then mount them manually in the script, but try this first.
 
Waragainstsleep Aug 2, 2013 05:39 AM
Thats basically what I did except the drives both have the same name and the shell script was run from within an Applescript since iCal will only run Applescripts from events. Or at least it would. It doesn't in Mountain Lion that I can find.

Trouble is I log into a server with this setup and I get presented with a whole raft of error dialogues that have just popped up once or twice per day since my last log in.

This is so simple it should be possible to do it in a robust fashion right?
 
P Aug 2, 2013 05:51 AM
If you want to avoid the error messages, the only way I can think of is to disable auto mount for these drives and have a script that mounts them manually.
 
Waragainstsleep Aug 2, 2013 12:31 PM
The errors were mostly about the scripts not running.
 
hayesk Aug 2, 2013 04:14 PM
Mountain Lion's iCal stopped supporting "Run AppleScript" alerts.

The trick is to use Automator. Make a "Calendar Alarm" automator action. Then add the "Run AppleScript" step and paste your AppleScript there. Then save it and schedule it in iCal.

In iCal, make an event, set the Alert to "open file" and set it to open "yourcalendaralarm.app" that you just saved from Automator.
 
All times are GMT -4. The time now is 07:18 AM.

Copyright © 2005-2007 MacNN. All rights reserved.
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2014, vBulletin Solutions, Inc.


Content Relevant URLs by vBSEO 3.3.2