![]() |
|||||||||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
#1
|
|||
|
|||
modifying copyjob.scpt to automount/unmount drive??
I know this question has been asked and discussed repeatedly throughout these forums, and believe me, I have searched for the answers and I've tried my best to get the job done without posting my own question about it, however due to the fact that my Apple Scripting expertise is completely nonexistent, my best attempts have failed in every respect...
Perhaps somebody can help me figure out how to accomplish the task of automounting my chosen backup hard drive prior to running SuperDuper to create a backup, and automatically on mounting the same drive after SuperDuper has finished backing up. This is about as far as I've gotten in the process: Code:
-- SuperDuper! scheduled copy script template (c) 2005-2008 by Bruce Lacey. Published by Shirt Pocket. -- Script by Dave Nanian and Bruce Lacey beforeRunningCopy() tell application "Finder" if not (exists the disk "Macintosh HD Clone") then try do shell script "diskutil mount `disktool -l | grep 'Macintosh HD Clone' | sed 's/.*\\(disk[0-9s]*\\).*/\\1/'`" end try repeat while not (exists the disk "Macintosh HD Clone") delay 1 end repeat end if end tell end beforeRunningCopy on afterRunningCopy() tell application "Finder" if (exists the disk "Macintosh HD Clone") then eject "Macintosh HD Clone" delay 2 end if delay 2 end afterRunningCopy 'Syntax Error' - Expected end of line, etc. but found identifier" It then highlights the word "beforeRunningCopy" in the "end beforeRunningCopy" line of text in the script above (and it does the same thing for "end afterRunningCopy") For the life of me I cannot figure out how to fix the script so that it doesn't result in this error message! Any assistance that anyone can offer to help me accomplish the task of Mounting my chosen backup (clone) hard drive before SuperDuper performs its cloning procedure, and un-mounting it after it has done so, would be greatly appreciated! Thanks, and I look forward to your responses! |
#2
|
|||
|
|||
I think I got it figured out....can someone confirm that the following code will mount my external hard drive ("Macintosh HD Clone") prior to running SuperDuper, and will also unmount the drive after the cloning process has completed...
Code:
-- SuperDuper! scheduled copy script template (c) 2005-2008 by Bruce Lacey. Published by Shirt Pocket. -- Script by Dave Nanian and Bruce Lacey on beforeRunningCopy() tell application "Finder" if not (exists the disk "Macintosh HD Clone") then try do shell script "diskutil mount `disktool -l | grep 'Macintosh HD Clone' | sed 's/.*\\(disk[0-9s]*\\).*/\\1/'`" end try repeat while not (exists the disk "Macintosh HD Clone") delay 1 end repeat end if end tell end beforeRunningCopy on afterRunningCopy() delay 2 tell application "Finder" if (exists the disk "local_home_backup") then eject "local_home_backup" delay 2 end if eject "External HD" end tell end afterRunningCopy |
#3
|
||||
|
||||
You're referencing three entirely different disks there - one is called "local_home_backup", one is called "External HD", and one is called "Macintosh HD Clone".
__________________
--Dave Nanian |
#4
|
|||
|
|||
Forgive the incorrect references...I'd obviously copied and pasted the code above from a previous thread I'd come across (and didn't replace the drive references in that code with the actual drive names I'll be using)...I tried using the code from the second post of this thread (replacing the 'External HD' portion with the correct hard drive references (which is Macintosh HD Clone), and it appears to have worked...
Can you confirm that this is the correct addition to the copy script I should apply (for an external drive named 'Macintosh HD Clone'): Code:
-- SuperDuper! scheduled copy script template (c) 2005-2008 by Bruce Lacey. Published by Shirt Pocket. -- Script by Dave Nanian and Bruce Lacey beforeRunningCopy() tell application "Finder" if not (exists the disk "Macintosh HD Clone") then try do shell script "diskutil mount `disktool -l | grep 'Macintosh HD Clone' | sed 's/.*\\(disk[0-9s]*\\).*/\\1/'`" end try repeat while not (exists the disk "Macintosh HD Clone") delay 1 end repeat end if end tell end beforeRunningCopy on afterRunningCopy() tell application "Finder" if (exists the disk "Macintosh HD Clone") then eject "Macintosh HD Clone" delay 2 end if delay 2 end afterRunningCopy |
#5
|
||||
|
||||
Looks about right.
__________________
--Dave Nanian |
#6
|
|||
|
|||
Thanks...It ran, and it did appear to work, but I still appreciate the admin confirmation that things look setup correctly...
Thanks again! |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Windows equivalent to SuperDuper!? | jreffner | General | 21 | 08-13-2009 05:36 PM |
Help relating to replacing an internal drive | Nigell | General | 1 | 03-01-2007 01:39 PM |
Best process to replace internal hard drive using SuperDuper!? | emikysa | General | 26 | 02-09-2007 05:03 PM |
Formatting an external hard drive for both Mac and PC | Mary Grimsley | General | 5 | 11-25-2006 02:40 PM |
Long Hang While Copying | BackerUpper | General | 4 | 06-12-2006 08:26 AM |