|
#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
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. |
#3
|
|||
|
|||
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 |
#4
|
||||
|
||||
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. |
#5
|
||||
|
||||
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 |
#6
|
||||
|
||||
Thanks for saying it more clearly and writing an example script.
|
#7
|
|||
|
|||
Quote:
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) Suggestions? thx Gary |
#8
|
|||
|
|||
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. |
#9
|
|||
|
|||
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:
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" & Thanks Gary Last edited by Gary@tmi; 07-22-2009 at 08:57 PM. |
#10
|
||||
|
||||
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 |
Tags |
eject, network, volume |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
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 |