Shirt Pocket Discussions  
    Home netTunes launchTunes SuperDuper! Buy Now Support Discussions About Shirt Pocket    

Go Back   Shirt Pocket Discussions > SuperDuper! > General

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-05-2008, 06:52 AM
m021478 m021478 is offline
Registered User
 
Join Date: Mar 2008
Posts: 8
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
For some reason, when I press the compile button in the script editor to check for errors in the way the script has been written, I am consistently getting the following error message:

'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!
Reply With Quote
  #2  
Old 04-05-2008, 07:25 AM
m021478 m021478 is offline
Registered User
 
Join Date: Mar 2008
Posts: 8
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
Thanks!
Reply With Quote
  #3  
Old 04-05-2008, 09:12 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
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
Reply With Quote
  #4  
Old 04-05-2008, 03:25 PM
m021478 m021478 is offline
Registered User
 
Join Date: Mar 2008
Posts: 8
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
Reply With Quote
  #5  
Old 04-05-2008, 10:46 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Looks about right.
__________________
--Dave Nanian
Reply With Quote
  #6  
Old 04-07-2008, 01:02 AM
m021478 m021478 is offline
Registered User
 
Join Date: Mar 2008
Posts: 8
Thanks...It ran, and it did appear to work, but I still appreciate the admin confirmation that things look setup correctly...

Thanks again!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 08:03 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.