|
#1
|
|||
|
|||
Scripts
As I've got a seperate backup partition (as I'm sure most of us have), I don't really want this mounting on the desktop all the time.
Is there a way to do a script or something, so that when SD starts it's scheduled backup, it mounts my backup partition, does the backup, and then unmounts it afterwards (and sends my computer to sleep as normal)? |
#2
|
||||
|
||||
There are number of suggested scripts and the like that do that elsewhere on the forum, Mark. Have a look around and you should find something to your liking.
__________________
--Dave Nanian |
#3
|
|||
|
|||
Thanks Dave.
|
#4
|
|||
|
|||
OK, I've had a good look around, and I've played around with some scripts to get one that actually complies ok with no errors.
I thought this one would work, but it doesn't. Can anyone tell me where I've gone wrong? The partition I want to mount is called Backup, and according to Disk Utility it's disk identifier is disk0s5, so I put that into the script... ===== -- SuperDuper! scheduled copy script template (c) 2005-2006 by Bruce Lacey. Published by Shirt Pocket. -- Script by Dave Nanian and Bruce Lacey on beforeRunningCopy() tell application "Finder" if not (exists the disk Backup) then do shell script "diskutil mount `disktool -l | grep 'Backup' | sed 's/.*\\(disk0s5*\\).*/\\1/'`" delay 1 end if end tell delay 2 end beforeRunningCopy on afterRunningCopy() tell application "Finder" if (exists the disk "Backup") then eject "Backup" delay 2 end if end tell delay 2 end afterRunningCopy |
#5
|
||||
|
||||
Well, Mark, if you know it's disk0s5 already, and you're basically locking it down to that device ID in your expression, there's no point doing the while disktool -l bit. Instead, to see if it works, just do a mount of disk0s5:
do shell script "diskutil mount disk0s5"
__________________
--Dave Nanian |
#6
|
|||
|
|||
I've done diskutil mount disk0s5, and diskutil unmount disk0s5 in terminal, and both work perfectly.
However, my script doesn't appear to work (it won't mount Backup if it's not already mounted):- on beforeRunningCopy() tell application "Finder" if not (exists the disk Backup) then do shell script "diskutil mount disk0s5" delay 1 end if end tell delay 2 end beforeRunningCopy on afterRunningCopy() tell application "Finder" if (exists the disk "Backup") then eject "Backup" delay 2 end if end tell delay 2 end afterRunningCopy What am I doing wrong? |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Run Shell Scripts | cucciasv | General | 1 | 02-26-2006 09:31 PM |
Partitioning & Bu Strategy & scripts | MacMedix | General | 1 | 09-19-2005 09:09 PM |
Scheduled SU backups | edoates | General | 2 | 07-27-2005 06:53 PM |
What does Edit > Show All Copy Scripts do? (seriously) | Darkside | General | 3 | 05-12-2005 11:01 AM |
Questions about "exclude system cache/temporary files" Copy Scripts | Darkside | General | 1 | 05-12-2005 09:48 AM |