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 |
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?
|
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 |
Thanks for saying it more clearly and writing an example script.
|
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 |
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. |
Quote:
Code:
Suggestions? thx Gary |
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. |
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 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 Thanks Gary |
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.
|
Thanks dnanian. Add "Volumes" worked perfectly!
The schedule copy now unmounts the Drobo as needed. Gary |
All times are GMT -4. The time now is 03:30 PM. |
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.