Shirt Pocket Discussions

Shirt Pocket Discussions (http://www.shirt-pocket.com/forums/index.php)
-   General (http://www.shirt-pocket.com/forums/forumdisplay.php?f=6)
-   -   Request for help with an AppleScript to run two SD SmartUpdates (http://www.shirt-pocket.com/forums/showthread.php?t=738)

emikysa 10-13-2005 12:37 PM

Request for help with an AppleScript to run two SD SmartUpdates
 
Hello,

I would like to have a script that can run SuperDuper Smart Updates involving two SD session setting files that involve three hard drives. I think that what I want to do is relatively simple to accomplish using AppleScripts, but I don't know anything about AS, so I'm hoping that an SD user that is good with AppleScript can spend a few minutes to help me. Perhaps you? :)

In my Backups folder (this path: PB80-MAIN-EM/Users/emikysa/Documents/Computing, Web/Backups/) I have two SuperDuper session settings files, called Backup-PB-to-OW-Bootable-SD and Backup-LCScr84-to-OWBkScr84-SD. The first one makes a bootable backup of my PowerBook's internal hard drive to a partition on an external Other World FireWire drive, and the second one backs up a partition on an external LaCie FireWire drive to second partition on the external Other World FireWire drive.

I would like to have a script that I can set to run in the middle of the night that will
- run the first backup (Backup-PB-to-OW-Bootable-SD), then
- run the second backup (Backup-LCScr84-to-OWBkScr84-SD), then
- put my PowerBook to sleep (or shut it down)

The SuperDuper example Daily Backup scrip as well as another script that I found when reading discussion postings are copied below. Perhaps one of them can be altered to do what I want?

I'd really appreciate help!

Best,
Erik

btw, I've registered my copy of SD, and I'm running OS X 10.4.2.


------------------------------------------------------------------------

tell application "SuperDuper!"
try
--Wait until SuperDuper! is idle before loading and running the desired session
repeat while status is not idle
--Sleep # seconds is the best way to "wait" without using the CPU
tell application "System Events" to do shell script "sleep 5"
end repeat
if status is idle then
--Specify the saved settings as either an absolute path or just the name
run using settings "Daily Backup" without user interaction
end if
--Wait until the session is done
repeat while status is running
--Sleep # seconds is the best way to "wait" without using the CPU
tell application "System Events" to do shell script "sleep 5"
end repeat
on error errMsg
display dialog errMsg & " See section 12 of the User's Guide for help with this script."
end try
--Once done, tell SuperDuper! to quit
quit
end tell

------------------------------------------------------------------------

(* Rotating Backup - use a cyclic sequence of SuperDuper! backup settings *)

-- allBackupSettings should contain the names of all saved SuperDuper! backup settings to cycle through
-- any external volumes referenced in the saved backup settings used should be mounted before running this script
property allBackupSettings : {"Smart Backup All To Volume 1", "Smart Backup Users To Volume 2", "Smart Backup All to Sparse Image 1", "Smart Backup Users To Sparse Image 2"}

-- backupSettings will retain the name of the backup settings used for the last successfully completed backup
property backupSettings : ""

-- set new backup settings to use, cycling through the list of saved settings
set previousBackupSettings to backupSettings
if backupSettings is "" or backupSettings is last item of allBackupSettings then
set backupSettings to first item of allBackupSettings
else
repeat with i from 1 to (count allBackupSettings)
if backupSettings is item i of allBackupSettings then
set backupSettings to item (i + 1) of allBackupSettings
exit repeat
end if
end repeat
end if

(*
-- uncomment these five lines if you always want to manually confirm or select from the backup settings list
set backupSettings to first item of (choose from list allBackupSettings with prompt "Confirm or select backup settings to use:" default items backupSettings without multiple selections allowed and empty selection allowed)
if backupSettings is false then
set backupSettings to previousBackupSettings
quit
end if
*)

tell application "SuperDuper!"
try
--Wait until SuperDuper! is idle before loading and running the desired session
repeat while status is not idle
--Sleep # seconds is the best way to "wait" without using the CPU
tell application "System Events" to do shell script "sleep 5"
end repeat
if status is idle then
--Specify the saved settings as either an absolute path or just the name
--run using settings "Daily Backup" without user interaction
run using settings backupSettings without user interaction
end if
--Wait until the session is done
repeat while status is running
--Sleep # seconds is the best way to "wait" without using the CPU
tell application "System Events" to do shell script "sleep 5"
end repeat
on error errMsg
-- backup failed, so restore saved backup settings last used
-- N.B. backup stopped by user is considered successful by SuperDuper! in this context
set backupSettings to previousBackupSettings
display dialog errMsg & " See section 12 of the User's Guide for help with this script."
end try
--Once done, tell SuperDuper! to quit
quit
end tell

dnanian 10-13-2005 12:58 PM

Erik --

Sorry that I don't have time to do this for you right now, but I can say that it's going to be very easy to do with v2.0, with no scripting at all...

emikysa 10-13-2005 01:10 PM

Okay, thanks anyway Dave.
Perhaps another Apple Script guru might help me.
If I knew when 2.0 was coming out perhaps I would wait, but I know better than to ask. :)


All times are GMT -4. The time now is 05:25 AM.

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