Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Time Machine, Multiple Disks, Headless Macs

Time Machine, Multiple Disks, Headless Macs
Thread Tools
Waragainstsleep
Posting Junkie
Join Date: Mar 2004
Location: UK
Status: Offline
Reply With Quote
Aug 1, 2013, 05:00 AM
 
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?
I have plenty of more important things to do, if only I could bring myself to do them....
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
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.
The new Mac Pro has up to 30 MB of cache inside the processor itself. That's more than the HD in my first Mac. Somehow I'm still running out of space.
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
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.
The new Mac Pro has up to 30 MB of cache inside the processor itself. That's more than the HD in my first Mac. Somehow I'm still running out of space.
     
Waragainstsleep  (op)
Posting Junkie
Join Date: Mar 2004
Location: UK
Status: Offline
Reply With Quote
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?
I have plenty of more important things to do, if only I could bring myself to do them....
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
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.
The new Mac Pro has up to 30 MB of cache inside the processor itself. That's more than the HD in my first Mac. Somehow I'm still running out of space.
     
Waragainstsleep  (op)
Posting Junkie
Join Date: Mar 2004
Location: UK
Status: Offline
Reply With Quote
Aug 2, 2013, 12:31 PM
 
The errors were mostly about the scripts not running.
I have plenty of more important things to do, if only I could bring myself to do them....
     
hayesk
Guest
Status:
Reply With Quote
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.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 07:58 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,