Jump to content

Can't get event handler to start


Recommended Posts

I've been using Retrospect for 9 years and have had good experience using Retrospect's event handlers on OS 9.

I'm reasonably proficient in Applescript. I've haven't used the event handlers for a few years now, and now I'm

trying to get simple event handlers to work on Tiger with Retrospect 6.1 on Intel Mac. My problem is that I can't get

Retrospect to start the event handler app at all. My event handler was taken from Retrospect's sample one (I've tried

several, even one of the send-mail examples). I have uncommented all handlers and have cut them all down to just

displaying a dialog box so I know that each was invoked. Nothing comes up, regardless of restarting Retrospect,

rebooting, etc. No dialog on Retrospect startup, quit, script startup, script end, nothing.

 

What is curious is that when I go into the Script Editor and open my Retrospect Event Handler (which I have

placed in /Library/Preferences/Retrospect (the top level one, not my user one, is that right?) and go to Save As

the "Stay Open" check box is unchecked even though I had saved it that way, as an application (I had read in the

Retrospect User's Guide that it should be saved with the "Stay Open" option on -- Yes, I'm so desparate that I'm even

reading documentation!) Sometimes the "Startup Screen" comes up checked even though I hadn't specified it when

I saved it previously. So, I have little confidence that my Retrospect Event Handler is in the proper condition for it to

run.

 

Getting this to work is critical for me. Before a script runs, I want to make sure the client to be backed up is

not sleeping. Retrospect doesn't wake up a client that is sleeping. So, with the event handler for scripts

starting, I can activate the cool WakeOnLan free utility to wake up the client. If I can get this to work, I'll gladly

share this with the rest of you!

 

But first, can you help me just get basic event handler to run with Retrospect?

 

Thanks!

Link to comment
Share on other sites

Quote:

Sometimes the "Startup Screen" comes up checked even though I hadn't specified it when

I saved it previously. So, I have little confidence that my Retrospect Event Handler is in the proper condition for it to run.

 


 

 

The Event Handler is just an AppleScript; nothing specific to Retrospect other then the text inside. You could make a new Script Editor document and copy/paste the text from the sample script; the resulting file will be fresh and clean, and should behave as any other new script would behave on your system.

 

The OS X version of Script Editor will append ".app" to a filename when you save as an application (which may not be visable in the Finder, depending on your system configuration). You'll need to remove this file extension from your script, as Retrospect is looking for the file by name, and it must match exactly.

Link to comment
Share on other sites

My suggestion is to use the Python version because it isolates you from changes in mail clients. The installation is rather straightforward; here's the KB article where you can download it.

http://kb.dantz.com/article.asp?article=5256&p=2

 

If you have difficulty installing it, send me a private message with your email address and I'll email you ours which uses the more elaborate features as well (trigger scripts, etc.), and which also has an enhancement fix posted in the forums about a year back or so that allows email addresses of the form:

"User Name <user@domain.com>".

 

It all "just worked" for us on Mac OS X 10.4.x Server, just as it did on ASIP 4.x before that.

 

You just have to save the edited "Retrospect Event Handler" in /Library/Preferences/Retrospect, save as application, stay open, never show startup screen, then delete the .app extension that Script Editor adds (because Retrospect expects the event handler to be named EXACTLY as "Retrospect Event Handler").

 

Russ

Link to comment
Share on other sites

First I have heard about removing the .app extension. Mucho thanks.

Removing that got things running. Now I can try to add my 'real' script

logic for waking up my sleeping clients.

 

I wish I had asked earlier. Would have saved me parts of two weekends

trying to get this to work...

 

Thanks again!

Link to comment
Share on other sites

I got the wakeup-client-on-script-startup working. Use the following as a guideline.

My script names are well formed in the format <machine name>(Sys|Users)Bkup.

I hope others find this useful. THANKS for your help!

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

property diskname : "BackupHD"

on scriptStart given scriptName:theScript, startDate:theDate

-- Make sure the backup disk is mounted

tell application "Finder"

if not (exists the disk diskname) then

set deviceName to do shell script "diskutil list | grep \"" & diskname & "\" | awk '{print $6}'"

do shell script "diskutil mountDisk /dev/" & deviceName

end if

end tell

 

-- Figure out the client name. Pair off the usual endings of the

-- script name to get the client name.

set scriptClientOff to offset of "SysBkup" in theScript

if (scriptClientOff is equal to 0) then

set scriptClientOff to offset of "UsersBkup" in theScript

end if

 

-- Get the script name's prefix. This is the client's name

if (scriptClientOff is greater than 0) then

set scriptClientName to text 1 thru (scriptClientOff - 1) of theScript

-- If we have a client name, then make sure its not for the backup

-- machine itself (which must already be awake to be running this!)

if (scriptClientName is not equal to "BackupServer") then

 

-- Wakeup the client & exit the app

tell application "WakeOnLan"

wakeup scriptClientName

end tell

tell application "WakeOnLan"

with timeout of 20 seconds

quit

end timeout

end tell

-- Give the client a few seconds to wake up before

-- Retrospect tries to contact it.

delay 8

end if

end if

 

-- Now, back to the backup script!

tell Retrospect

activate

end tell

end scriptStart

Link to comment
Share on other sites

That's very useful. I knew that WakeOnLan could send the magic packet to wake up clients, but I didn't know that it was scriptable to wake up a client. That's something good to know. I had been setting the energy saver preference pane on clients to wake up 5 minutes before the Retrospect backup, but your method is much better.

 

This might be useful for a tech note by EMC, because the question of waking up sleeping clients arises frequently in these forums. Yours is the first real solution that I have seen.

 

Thanks.

 

Russ

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...