Shirt Pocket Discussions  
    Home netTunes launchTunes SuperDuper! Buy Now Support Discussions About Shirt Pocket    

Go Back   Shirt Pocket Discussions > SuperDuper! > General

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-21-2009, 01:07 AM
Gary@tmi Gary@tmi is offline
Registered User
 
Join Date: Sep 2007
Posts: 5
Question Is there a way eject a Network mount

I have created a scheduled backup to a disk image on a network volume. SD mount the Network volume and then the disk image without issue. However, even thought the disk image is ejected after the copy, the network volume is not eject. I would also like the Network volume ejected after the copy is completed.

I have created a simple apple script to eject the network volume, but can't figure out a way to run the script AFTER the disk image is ejected. Run script after copy, runs before the disc image is ejected, so the script fails.

Is there a way to eject the network volume after the target disk image is ejected?

Thanks
Gary
Reply With Quote
  #2  
Old 07-21-2009, 01:44 AM
sjk's Avatar
sjk sjk is offline
Registered User
 
Join Date: May 2004
Location: Eugene
Posts: 252
One way would be to unmount the network volume after sleeping in the background long enough for the disk image volume to unmount. Are you running your script with the "Run shell script after copy completes" option?

Last edited by sjk; 07-21-2009 at 03:29 PM.
Reply With Quote
  #3  
Old 07-21-2009, 08:31 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
sjk's right here - you'd have to run a shell script, in the background, to do it. Something along the lines of:

Code:
#!/bin/sh
nohup /bin/bash -c "sleep 30; diskutil eject /some/volume" &
__________________
--Dave Nanian
Reply With Quote
  #4  
Old 07-21-2009, 03:30 PM
sjk's Avatar
sjk sjk is offline
Registered User
 
Join Date: May 2004
Location: Eugene
Posts: 252
Thanks for saying it more clearly and writing an example script.
Reply With Quote
  #5  
Old 07-21-2009, 10:00 PM
Gary@tmi Gary@tmi is offline
Registered User
 
Join Date: Sep 2007
Posts: 5
Thanks sjk.

Yes, I am trying to use "Run shell script after copy completes", but I am running an apple script, not a shell script.

I have never run a shell script before, so I will have to research that a bit. Dnanian, do you have a recommendation on how to create the shell script? Do, I just create a text file?

Thx
Gary
Reply With Quote
  #6  
Old 07-21-2009, 11:32 PM
sjk's Avatar
sjk sjk is offline
Registered User
 
Join Date: May 2004
Location: Eugene
Posts: 252
Yes, shell scripts can be created with your favorite text editor. TextEdit would work fine, saving as Plain Text instead of Rich Text. You'd need to make the script executable and might want to change its extension from .txt (e.g. to .sh).

A simple shell script could use osascript to run your AppleScript.

Or, if your AppleScript is a compiled executable command then SD!'s "Run shell script after copy completes" option should be able to run it.

I'm intentionally terse with details here but plenty can be found with a bit of searching.
Reply With Quote
  #7  
Old 07-21-2009, 11:58 PM
Gary@tmi Gary@tmi is offline
Registered User
 
Join Date: Sep 2007
Posts: 5
Quote:
Originally Posted by dnanian View Post
sjk's right here - you'd have to run a shell script, in the background, to do it. Something along the lines of:

Code:
#!/bin/sh
nohup /bin/bash -c "sleep 30; diskutil eject /some/volume" &
I created a text files with the script as discribed, but it results in an error:

Code:
| 09:51:36 PM | Info | ...ACTION: Running shell script eject Drobo2
| 09:51:36 PM | Info | ......COMMAND => Invoking After Copy shell script: /Users/garysumlak/Documents/!Shell Scripts/eject Drobo2
| 09:51:36 PM | Error | sh: /Users/garysumlak/Documents/!Shell Scripts/eject Drobo2: Permission denied
| 09:51:36 PM | Error | ****FAILED****: result=32256 errno=0 (Unknown error: 0)
I am thinking I have to use SUDO, but have no idea how to do this.

Suggestions?

thx
Gary
Reply With Quote
  #8  
Old 07-22-2009, 01:49 AM
chris_johnsen chris_johnsen is offline
Registered User
 
Join Date: Jan 2007
Posts: 79
You probably just need to make it executable (SuperDuper! run the script as root already).

Do chmod +x '/Users/garysumlak/Documents/!Shell Scripts/eject Drobo2' in a Terminal window.
Reply With Quote
  #9  
Old 07-22-2009, 08:40 PM
Gary@tmi Gary@tmi is offline
Registered User
 
Join Date: Sep 2007
Posts: 5
Thanks Chris. I added ".sh" to the file and changed the attribute to executable.

Although I do not get errors anymore, the network drive does not get unmounted.

Basically, my intent is to NOT have the network drive mounted after the copy is completed.

Maybe I should explain my situation:
  1. I have a Drobo attached to FW800 on a PowerMac G5 Quad.
  2. I create a NetWork Backup folder on the Drobo as the destination for disc image backups from SD.

    NOTE: I do NOT share the Drobo volume
  3. I go to each Mac in our home office, mount the Drobo via "Connect As..." into the Admin account of the Drobo's host Mac.
  4. Create an alias of the Drobo volume on the Desktop, so the Admin ID and Password will be automatically entered when the alias is used to access the Drobo. I found SD would not mount the Drobo automatically if I did not create the Alias.
  5. With the Network drive mounted, create the SD copy event and schedule for the backup.
  6. (What I would like to happen) After SD has completed the copy and unmounted the Disc Image, SD unmounts the Drobo volume.

What, happens is, SD works perfectly, mounting the Drobo volume, mounts the backup disk image, completes the copy, unmounts the disk image, and then SD quits. However, the Drobo volume is still mounted.

The log show no errors and the script was executed.

Code:
| 03:41:33 PM | Info | ...ACTION: Running shell script eject Drobo2.sh
| 03:41:33 PM | Info | ......COMMAND => Invoking After Copy shell script: /Users/garysumlak/Documents/!Shell Scripts/eject Drobo2.sh
| 03:41:33 PM | Info | ...ACTION: Unmounting G52KDP User Folders
| 03:41:33 PM | Info | ......COMMAND => Unmounting '/Volumes/Drobo2/Network Backups/SuperDuper/G52KDP User Folders.sparseimage'
| 03:41:37 PM | Info |       "disk1" unmounted.
| 03:41:37 PM | Info |       "disk1" ejected.
| 03:41:37 PM | Info | Copy complete.

I am wondering, does SD have to wait for the script to complete before it goes on to the next step - i.e. unmounting the disk image? I know this was the case with using the apple script.

The main reason I want to unmount the Drobo volume is that if I turn of the Quad, any Mac connect to the Drobo will lock up because the Drobo is no longer available.

Here is the script I am using:
Code:
#!/bin/sh
nohup /bin/bash -c "sleep 30; diskutil unmount Drobo2" &
Any suggestions would be greatly appreciated.

Thanks
Gary

Last edited by Gary@tmi; 07-22-2009 at 08:57 PM.
Reply With Quote
  #10  
Old 07-22-2009, 09:12 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
You can't unmount "Drobo2". You have to unmount the actual mount point - e.g. /Volumes/Drobo2, if that's where it's mounted. Try this in Terminal before you do it in the script.
__________________
--Dave Nanian
Reply With Quote
  #11  
Old 07-22-2009, 10:48 PM
Gary@tmi Gary@tmi is offline
Registered User
 
Join Date: Sep 2007
Posts: 5
Talking

Thanks dnanian. Add "Volumes" worked perfectly!

The schedule copy now unmounts the Drobo as needed.

Gary
Reply With Quote
Reply

Tags
eject, network, volume


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting 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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup to cheap network drive impossible? Schalke04 General 4 01-18-2009 05:59 AM
Disk Image Failed to Mount shmootz General 3 11-25-2008 11:58 AM
Auto Mount Network Volume/Image NormArmour General 8 05-09-2008 12:13 PM
Unable to mount sparse image on network attached drive mj71 General 2 09-22-2007 08:42 AM
Network drive won't auto mount Shamyl Zakariya General 7 06-05-2006 04:07 PM


All times are GMT -4. The time now is 07:31 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.