PDA

View Full Version : Auto-Ejecting a Network Drive Post-Backup


voxer18
09-22-2009, 05:28 PM
***I really did try to search first, both here and on Google***

Synopsis:

We have about 10 Macs in our office and also a Dell PowerEdge Server with a lot of storage on a large RAID and gigabit ethernet available. Several of the computers are already backed up via Time Machine, but I'd like to have bootable copies for everyone ready to go. I'm the test mule.

What I've got thus far:

(1) Marco Polo recognizes I'm at the office, waits a little bit and runs an Automator file that (2) mounts the network drive, (3) sends a growl notification not to interfere, and (4) loads SD via the personalized settings file through AppleScript, which then, after backup, (5) ejects the image that it's updating (Smart backup) on the server and (6) closes SD. (5 & 6 are from within SD.)

So far, so good.

Could someone help me with writing a script to have SD run at the end that does last step of ejecting the network drive?

Our Macs connect to the windows server via SMB. The actual address is: "smb://192.168.0.5/Mac Backups" (or "smb://192.168.0.5/Mac%20Backups" if it can't use the space")

Thanks!!!

jim

sjk
09-22-2009, 08:01 PM
Related topic:

Is there a way eject a Network mount (http://www.shirt-pocket.com/forums/showthread.php?t=5466)

voxer18
09-22-2009, 09:15 PM
I saw that and maybe I'm too much of a novice, but I'm confused as to what I actually have to have in there and what - if any - my SMB-based setup has on things. Thanks!

voxer18
09-23-2009, 10:16 AM
One of the main issues I can't figure out in the other thread linked above is that the Terminal commands are utilizing Disk Utility, but in our setup, my network volume doesn't show up in Disk Utility like a physically attached drive via USB, FireWire, etc.

voxer18
09-23-2009, 10:59 AM
So in terminal I can eject ANOTHER drive with this:

umount -f /volumes/users

But HOW ON EARTH, if the drive I need to unmount is: "Mac Backups" do I account for the space???

These haven't worked:

umount -f /volumes/mac backups
umount -f /volumes/Mac%20Backups
umount -f '/volumes/Mac Backups'
umount -f "/volumes/Mac Backups"
umount -f /volumes/mac_backups
umount -f /volumes/mac\ backups

I'm at a loss...

I didn't name the drive initially, and I could obviously change it, but I'd rather figure it out this way so that I don't have to change my SD file and my Automator file. And I don't want to lose to space. :)

dnanian
09-23-2009, 11:08 AM
Did you try

diskutil eject "/Volumes/Mac Backups"

by chance?

voxer18
09-23-2009, 11:11 AM
Those don't work for our setup (including the "User" drive that unmount under the other input I've used.". Thanks though!

dnanian
09-23-2009, 11:18 AM
What about the same using "unmount" instead of "eject"?

voxer18
09-23-2009, 11:23 AM
Okay...this is weird (at least to me):

I found the "df" command from google and saw that I had "/Volumes/Mac Backups-1" mounted. I restarted and reconnected the drive. It showed up like it should as: "/Volumes/Mac Backups" and so I ran:

"umount -f /Volumes/Mac\ Backups"

and it worked! I'm not sure where things got weird...

voxer18
09-23-2009, 11:26 AM
So now that appears to be okay...and I'm trying to decipher in the other thread what needs to go ahead of it in text document to make it an executable script. Any thoughts? Thanks!

jim

voxer18
09-24-2009, 11:19 AM
I just ended up adding a healthy pause to my Automator workflow and then it executes the unmount command for me. FYI - on the two office iMacs that don't leave, I setup to wake from sleep and execute the Automator app via iCal and go back to sleep...gonna rock!!!