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

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


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:// Backups" (or "smb://" if it can't use the space")



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

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

09-22-2009, 10: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!

09-23-2009, 11: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.

09-23-2009, 11: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. :)

09-23-2009, 12:08 PM
Did you try

diskutil eject "/Volumes/Mac Backups"

by chance?

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

09-23-2009, 12:18 PM
What about the same using "unmount" instead of "eject"?

09-23-2009, 12:23 PM
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...

09-23-2009, 12:26 PM
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!


09-24-2009, 12:19 PM
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!!!