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 06-18-2009, 11:11 PM
ixnayus ixnayus is offline
Registered User
 
Join Date: Jun 2009
Posts: 4
Question How do I trigger one SD unattended backup from another?

I just got an external 1tb drive that I want to use to back up two separate internal drives. The problem is I want to do this unattended but I can't seem to figure out a way to run two jobs sequentially.

My desired workflow would be to have an automator action that triggers the first backup. I'd turn off my monitors and head home for the night while SD! does it's magic. When the first backup is complete, it would trigger the second backup. When the second is done, it would put the computer to sleep.

Now, I had a similar setup running just fine with a single SD! backup. My automator script used applescript to launch the SD! job and it would put the computer to sleep when it is done. However, now that I've introduced the second job into the mix, I need a way to trigger the second job once the first is done. Scheduling isn't a viable option since I don't know when the first job will be done. And Automator doesn't wait for the first job to complete before moving on with it's workflow once an unattended job starts running.

Can anyone suggest a way to do this? Details rather than generalities would be most appreciated, but, in truth, I'll take what I can get at this point.

Many thanks,
Steve
Reply With Quote
  #2  
Old 06-19-2009, 06:57 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 don't have to know when the first job is done to do it with scheduling. Just set them one minute apart and we'll do the rest.
__________________
--Dave Nanian
Reply With Quote
  #3  
Old 06-20-2009, 11:15 PM
ixnayus ixnayus is offline
Registered User
 
Join Date: Jun 2009
Posts: 4
Quote:
Originally Posted by dnanian View Post
You don't have to know when the first job is done to do it with scheduling. Just set them one minute apart and we'll do the rest.
Thanks for the tip, but unfortunately I can't rely on a scheduled trigger since I don't always leave the drive on and attached. I'd really just like to trigger the jobs on an as-needed basis.

Can I fire a unattended job with a shell script, maybe?

Thanks,
Steve
Reply With Quote
  #4  
Old 06-21-2009, 12:22 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 can review the "One Touch Button" FAQ entry and use a similar technique, sure.
__________________
--Dave Nanian
Reply With Quote
  #5  
Old 06-21-2009, 07:49 AM
ixnayus ixnayus is offline
Registered User
 
Join Date: Jun 2009
Posts: 4
Okay that worked. For posterity, here's what I did:

I have two internal drives, Sam & Max. I want to back them up on demand to an external drive ("MyBook") via an Automator Script. I want to leave this script running unattended after I leave for the night and have my computer sleep as soon as SuperDuper is done.

1) I create the SuperDuper jobs I want to run. I make sure the padlock icon is unlocked to allow the job to run unattended for both jobs.

2) I create an automator job that triggers the "Sam" job first. In a "Run AppleScript" workflow item:

Code:
tell application "SuperDuper!"
	run using settings "~/Library/Application Support/SuperDuper!/Saved Settings/Backup Sam to MyBook.sdsp" without user interaction
end tell
Save this as "SuperDuper! Sam to MyBook.app" (save as an app, not a workflow!) somewhere handy. This is the thing you'll launch when you want to kick off the whole chain.

3) I create a second automator script that triggers the "Max" job. Like the "Sam" job, create a "Run Applescript" workflow:

Code:
tell application "SuperDuper!"
	run using settings "/Users/ixnayus/Library/Application Support/SuperDuper!/Saved Settings/Backup Max to MyBook.sdsp" without user interaction
end tell
Save this in ~/Library/Application Support/SuperDuper!/Saved Settings as "SuperDuper Max to MyBook.app"

4) Open TextEdit and write "open " and then drag "SuperDuper Max to MyBook.app" onto it. You'll get a long command:

Code:
open /Users/ixnayus/Library/Application\ Support/SuperDuper\!/Saved\ Settings/SuperDuper\ Max\ to\ MyBook.app
Save this as a shell script: "Backup Max to MyBook.sh"

5) Here's an important step. You need to set permissions on the shell script so SuperDuper can open it without complaining.
From the terminal:

Code:
chmod 777 ~/Library/Application\ Support/SuperDuper\!/Saved\ Settings/Backup\ Max\ to\ MyBook.sh"
6) We now have all the pieces of the puzzle. Let's put it together. In SuperDuper!, open the "Sam" backup script. Click on the Options button. Click on Advanced. Check "Run shell script after copy completes" and navigate to the shell script you created in #4 above. Under "General" make sure "Do nothing" (default) is still selected under "On successful completion." Save the job.

7) Open the "Max" job in SuperDuper. Click "Options" then "General" and select "Sleep Computer" under "On successful completion". Save the job.


You now have an automator script that fires off a chain of events resulting in your backed up data and a sleepy computer.

Automator Backup Sam ->
SuperDuper Backup Sam ->
Shell - Open Automator Backup Max ->
SuperDuper Backup Max ->
Sleep computer


TIP: if you have Growl installed (http://growl.info/), you'll be greeted with a quick message when you start your computer up on whether the jobs completed successfully or not.


I hope this helps. Thanks, Dave, for pointing me in the right direction.
Reply With Quote
  #6  
Old 06-21-2009, 09:03 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
The only problem here is that you've run two jobs but only one can run at a time - and "run using settings" does not block. If you set things up as in the FAQ, and run the little program rather than directly running the settings, you'll leverage our "schedule driver", which knows how to queue the jobs, mount and unmount drives, etc.
__________________
--Dave Nanian
Reply With Quote
  #7  
Old 06-21-2009, 02:51 PM
ixnayus ixnayus is offline
Registered User
 
Join Date: Jun 2009
Posts: 4
Quote:
Originally Posted by dnanian View Post
The only problem here is that you've run two jobs but only one can run at a time - and "run using settings" does not block. If you set things up as in the FAQ, and run the little program rather than directly running the settings, you'll leverage our "schedule driver", which knows how to queue the jobs, mount and unmount drives, etc.
But the jobs aren't running concurrently, they're running sequentially. Automator triggers the first job which fires off the shell script triggering the second job once it's done. It worked for me, but maybe that was a fluke.

To do as the FAQ instructs, you'd replace my step #3 with the instructions in the faq...

http://tinyurl.com/ljv8pz

... and point the shell script to the resulting app from the FAQ instead of the automator "Max" job in my example step #4.
Reply With Quote
Reply

Tags
applescript, automator, scripting, unattended


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
Server drive won't mount after backup rhennosy General 1 11-09-2007 03:49 PM
Backup failure on a certain file bmat General 3 09-25-2007 09:06 AM
How to verify a Scheduled Backup? tuqqer General 3 12-06-2005 06:50 PM
(Zero-length) File caused SuperDuper to abort backup alancfrancis General 7 08-31-2005 10:42 AM
Smart Backup Error bill s General 20 02-04-2005 09:46 AM


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


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