|
#1
|
|||
|
|||
auto-disconnect "server" after copying files
When doing a scheduled backup over a network (to a disk image), SD! will correctly connect to the "server" (as needed) and mount the disk image file (as needed).
Is there a SIMPLE way to disconnect the "server" after SD! is finished copying? Not the disk image (that gets ejected/unmounted automatically), but the "server" itself... If the connection is left active but the server goes "off-line" sometime later, the Mac with SD! spends a lot of time looking for the "server" at that point, which is what I am trying to avoid. I tried an AppleScript in SD! to disconnect the "server" "after copying is finished" but that doesn't work because SD! tries to execute that script while the disk image is still mounted. Thank you. |
#2
|
||||
|
||||
There are some examples on the forums of this kind of thing. Basically, you'd need to use a "shell script" and put that in the background, waiting 30 seconds or so for the backup to fully complete...
__________________
--Dave Nanian |
#3
|
|||
|
|||
I've written a shell script that will do something just like this. What it does is check the MAC address of your current router. If that MAC address has changed then it will force dismount any AFP mounted disks and maybe any SSHFS mounted disks. I have this script run every minute via a launchd process that I set up with Lingon. The script will log its activity if you set it up that way. Here's the script. If you have any problems let me know. I've been running it here for over a month without problems.
I've name the script 'unmount.sh' Let me know what you think. If you have problems with it. Andy |
#4
|
|||
|
|||
Quote:
If only SD would disconnect the server (after unmounting the disk image file)... IOW if it could just reverse the procedure it does before copying... Not sure I'm making myself clear. It's just an annoyance factor, nothing more. Last edited by digSD; 05-10-2007 at 12:18 AM. |
#5
|
||||
|
||||
The script the user has provided can do this for you... I do understand what you want, but there are issues there that make this more difficult than you might expect at first...
__________________
--Dave Nanian |
#6
|
|||
|
|||
This script will do exactly what you want. I think.
Code:
#!/usr/bin/env bash sleep 45 if [[ `mount | awk '/^afp_/'` != "" ]]; then # http://www.macosxhints.com/article.p...51107175256782 mount | awk '/^afp_/ { system("umount -f " $3) }' echo $now "afp disk unmounted" fi Dave, if you want to include this script with SD feel free. Andy |
#7
|
|||
|
|||
Thanks. Sadly I know nothing of "shell scripts" and only a bit more about AppleScripts (apples and oranges?). A search of the forum did not reveal what I wanted. Oh well.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Smart Update copying files that haven't been changed? | salparadi | General | 3 | 11-05-2006 11:40 AM |
Copying newer files across volumes. | chip | General | 1 | 08-09-2006 08:07 PM |
Long Hang While Copying | BackerUpper | General | 4 | 06-12-2006 08:26 AM |
SuperDuper! Erasing Audio Files? | Emerson | General | 3 | 06-22-2005 01:41 PM |
Smart update copying all files each time | fabius | General | 15 | 05-29-2005 09:29 PM |