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 12-04-2005, 05:09 PM
chabig chabig is offline
Registered User
 
Join Date: Nov 2005
Posts: 10
Mounting an external volume before backup

I'm using SD 2.0.1. I keep an external drive attached, but unmounted. I wrote a small Applescript to mount the backup volume and I set the advanced options to run that script before beginning the backup. However, SD doesn't see the backup volume at launch so it never starts the backup, thus is never mounts the volume, so it can't start the backup, etc.

How do I get out of this circle?

Chris
Reply With Quote
  #2  
Old 12-04-2005, 05:42 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,782
Send a message via AIM to dnanian
If you're doing this scheduled, Control-click the settings package in the Scheduled Copies folder (in Library/Application Support/SuperDuper!). Then edit the Copy Job.applescript you find in there. Add your commands to mount/unmount to the documented areas at the top of the script.

Save the script file, then go into SD! Uncheck and re-check the schedule checkbox (Edit the schedule). That'll re-compile the script for you, and you should be all set.
__________________
--Dave Nanian
Reply With Quote
  #3  
Old 12-04-2005, 10:22 PM
chabig chabig is offline
Registered User
 
Join Date: Nov 2005
Posts: 10
Thanks Dave,

I thought there was an applescript interface somewhere, yet I am embarrassed to say I couldn't find it.

Chris
Reply With Quote
  #4  
Old 12-04-2005, 10:23 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,782
Send a message via AIM to dnanian
No problem, Chris. We're trying to decide if it makes sense to put in a button (or something) to expose the script for advanced users... but in the meantime going in the package will work, and should make you feel even more advanced!
__________________
--Dave Nanian
Reply With Quote
  #5  
Old 01-15-2006, 10:48 AM
Syzygies Syzygies is offline
Registered User
 
Join Date: Jan 2006
Posts: 23
Sample code?

Quote:
Originally Posted by chabig
I wrote a small Applescript to mount the backup volume
Does anyone have some sample code for this they'd like to share?

I have only seen code that makes Unix calls, referencing partitions using "disk0s10" and such. These descriptors aren't stable from boot to boot. They could work for years for one person, but fail on the first reboot for someone else. (This also comes up in moving swapfiles.)

Thanks,
Dave
Reply With Quote
  #6  
Old 01-15-2006, 11:33 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,782
Send a message via AIM to dnanian
The first solution in this thread users the drive name, not the device ID, and should work just fine.
__________________
--Dave Nanian
Reply With Quote
  #7  
Old 05-01-2006, 06:57 AM
bethri bethri is offline
Registered User
 
Join Date: Apr 2006
Posts: 7
Dave: for example, using this code as suggested:

Code:
property diskname : "G5Backup"

tell application "Finder"
	if not (exists the disk diskname) then
		do shell script "diskutil mount `disktool -l | grep 'G5Backup' | sed 's/.*\\(disk[0-9s]*\\).*/\\1/'`"
		delay 1
	end if
end tell

delay 2
gives me errors about multiple run handlers or top-level commands wherever in the script I try to place it.

Ben
Reply With Quote
  #8  
Old 05-01-2006, 08:57 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,782
Send a message via AIM to dnanian
Sure: that's because you need to put it *inside* the "on before" or "on after" handler, as appropriate, not at the top level (outside any on block).
__________________
--Dave Nanian
Reply With Quote
  #9  
Old 05-01-2006, 10:58 AM
bethri bethri is offline
Registered User
 
Join Date: Apr 2006
Posts: 7
That's what I figured (and tried) but:

Code:
on beforeRunningCopy()

-- Put your own code here that should execute just before running the copy.
-- Inserted to mount clone (G5Backup) before copying

Property diskname : "G5Backup"

tell application "Finder"
if not (exists the disk diskname) then
do shell script "diskutil mount `disktool -l | grep 'G5Backup' | sed 's/.*\\(disk[0-9s]*\\).*/\\1/'`"
delay 1
end if
end tell

delay 2

-- End of insertion

end beforeRunningCopy
gives me, 'Expected “end” but found “property”.' when I try to compile. Sorry I can't fix this myself but with my limited knowledge of Applescript, I can't see how to change this...
Reply With Quote
  #10  
Old 05-01-2006, 11:46 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,782
Send a message via AIM to dnanian
I'd suggest the following. Get rid of the Property, then:

Code:
beforeRunningCopy()
    -- Put your own code here that should execute just before running  
the copy.
    
tell application "Finder"
    if not (exists the disk "G5Backup") then
        try
            do shell script "diskutil mount `disktool -l | grep 'G5Backup' | sed 's/.*\\(disk[0-9s]*\\).*/\\1/'`"
        end try
        
        repeat while not (exists the disk "G5Backup")
            delay 1
        end repeat
    end if
end tell
    
end beforeRunningCopy
__________________
--Dave Nanian
Reply With Quote
  #11  
Old 05-01-2006, 04:44 PM
bethri bethri is offline
Registered User
 
Join Date: Apr 2006
Posts: 7
That's perfect, thanks Dave. I've got it scheduled now, so I'll check the log tomorrow, and here's hoping.

Many thanks, Ben
Reply With Quote
  #12  
Old 05-01-2006, 05:10 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,782
Send a message via AIM to dnanian
You can always set it to schedule for "a minute from now" so you can test without waiting overnight! :-)
__________________
--Dave Nanian
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
An (Applescript) hack to automate mounting and unmounting external volumes kbradnam General 12 07-30-2007 08:12 AM
Cannot copy from external backup to HD Tricia General 0 10-13-2005 10:38 AM
(Zero-length) File caused SuperDuper to abort backup alancfrancis General 7 08-31-2005 11:42 AM
automatic initiation of backup when I plugin/mount my external Firefox drive? mykmelez General 3 07-11-2005 04:00 PM
spotlight finds files on backup but not on source volume snoopy67 General 1 07-05-2005 09:29 AM


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


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