I'm using Finder's Folder Action "adding folder items to" to trigger a backup using SuperDuper! when:
1. A volume is mounted named like "B-Macintosh HD"
2. Another volume already mounted named like "Macintosh HD"
3. a SuperDuper! settings file exists with the name like "Backup Macintosh HD"
The script will work for any volume as long as there is a matched set when "Macintosh HD" is replaced by some other volume name. I can backup all the volumes on my computer plus any external drives I might want to backup as well.
This piece of Applescript code works but I was wondering if there was a better way to do this:
Code:
tell application "Finder"
-- ...
-- other code to verify proper backup conditions exist goes here
-- ...
with timeout of 3600 seconds
tell application "SuperDuper!"
run using settings SettingFile without user interaction
quit
end tell
repeat while (process "SuperDuper!" exists)
do shell script "sleep 10"
end repeat
end timeout
end tell
Is there a way to not use the "repeat" to see if SuperDuper! has finished? I put the "repeat" loop in because when I used a backup disk with multiple partitions that satisfied the 3 trigger conditions SuperDuper! seemed to be starting the next backup before it even finished the first one. I originally did the "quit" at the end of the script. It's as if the "run using settings SettingFile without user interaction" commands are placed into a queue and not waiting for each one to complete before moving on.
Also is there a way to get rid of the count down the precedes the start of the backup? My script asks if the backup is to be done if the 3 triggers are satisfied so a "Cancel" countdown is unnecessary.