PDA

View Full Version : another mount/unmount question


rdlsmith
08-06-2006, 08:11 PM
Okay I know this subject has been dealt with over and over but I still don't understand how to do what I need to do.

I have an external HD that I want to mount before the SD! job and unmount after the SD! job.

From my reading here I was able to create two applescripts that will mount and unmount. I saved them as applications. I can run them from the Finder by clicking on them and they work fine.

The problem is, the mount script doesn't run before SD! tries to access it.

Is there a way to have SD! run the mount script before it does anything?

I read the following from Dave:

"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."

I don't see the Copy Job.applescript you speak of. I see my scheduled job but what do I edit that with? That may have nothing to do with what I'm trying to do.

Here's my mount script:

set targetDisk to "LaCie Backup"
tell application "Finder"
if not (exists the disk targetDisk) then
try
do shell script "diskutil mount `disktool -l | grep '" & targetDisk & "' | sed 's/.*\\(disk[0-9s]*\\).*/\\1/'`"
end try

repeat while not (exists the disk targetDisk)
delay 1
end repeat
end if
end tell

Here's my unmount script:

set targetDisk to "LaCie Backup"
tell application "Finder"
if (exists the disk targetDisk) then
eject targetDisk
delay 2
end if
end tell

Again, those scripts work fine when selecting in Finder.

Thanks much,

Randall

dnanian
08-07-2006, 12:43 AM
If your copy is scheduled, Randall, we do this all automatically: you literally don't have to do anything...

rdlsmith
08-07-2006, 07:13 PM
If your copy is scheduled, Randall, we do this all automatically: you literally don't have to do anything...


I'm not sure what this means in relation to what I asked. I'm sure I've confused the issue somehow. Sorry.

In any case, if I don't have my external drive mounted, the scheduled backup will fail.

If I try to run a script before the backup starts, the backup tries to access the image (which is on the unmounted external) and fails before even trying to run the mount script.

Clear as mud?

dnanian
08-07-2006, 09:57 PM
Ah, it's in a sparse image on an external drive; got you. No, we won't automount in that case. Is there a reason you're not writing directly to the drive?

rdlsmith
08-07-2006, 10:22 PM
Ah, it's in a sparse image on an external drive; got you. No, we won't automount in that case. Is there a reason you're not writing directly to the drive?


I think so. Security? I think that was it. If I back up to a regular partition, anyone that walks off with the drive can mount it. A sparse image, if created first with the DU can have a password and it can't be opened if you don't have the password. You can't even backup to it without the password.

Also, the sparse image will grow as needed to the upper limit you created it with or space available on the drive. True? I think that's right. A partition, you pretty much have to know. You may only need 50 gigs today but 200 next year. That's a lot of wasted space.

Finally I like rolling backups. Now and then I'll make a permant backup. A snapshot if you will of how things looked on a particular date. Well, permanent until I replace it with another permanent one. The number of these I keep and how long I keep them sometimes will be determined by how much space I have on the drive. Images just work better for that.

Back to the original problem. I'm just learning AppleScript but I would think there's a way to schedule a script? If so, I could just call my mount script 2 minutes before the scheduled backup and then let the scheduled backup unmount when finished by calling the unmount script. That's gotta work yes?

Maybe I should find an AppleScript forum? ;)

Hey, consider this a request. I'd like to be able to run a script before the backup job. I mean it needs to run before SD! does anything. That would work nicely for what I'm trying to do.

No matter, SD! is still the best backup solution I've ever used for a home computer.

Keep 'em spinning!

rdlsmith
08-07-2006, 10:42 PM
I just tested this and it worked.

http://digitalmedia.oreilly.com/2005/02/02/hacktv.html

Page down to the section:

"Scheduling a Recording with iCal"

Use Open File. I even shut down iCal and it still ran. This may work.

dnanian
08-07-2006, 10:43 PM
Sure, that'll work! :)

rdlsmith
08-07-2006, 10:51 PM
Sure, that'll work! :)


Well that's just Super Duper!

I created a new scheduled script. I know that changing anything in the script means you have to delete the schedule and create it again.

The new script will not try and run anything before because iCal should take care of that for me. It will let SD! try and run the unmount script.

This is cool. I don't like having that drive mounted because it goes to sleep when not being used, which is probably a good thing, but then when I use spotlight it wakes up. Things slow down while that process is taking place. I don't want to have to remember to load it, connect it etc. It doesn't make much noise but compared to the iMac it's loud.

Anyway, thanks for your time as always.