Jump to content

Eudora event handler


Recommended Posts

Hi.

Using Retrospect 5.0.238 Server running on Mac OS 9.2.1 G4/450MHz. I installed the Eudora Event handler and it almost works. It sends e-mails every time the script is finished.

BUT, it NEVER sends any e-mails on media request. (That's when it's most needed!)

I never fill a tape, so I don't get any media requests that way.

I get a media request dialog on the server when a script starts and the wrong tape inserted, but I don't get e-mail notification.

 

What's up with this?

 

/Lennart

Link to comment
Share on other sites

Emails for media only happen after a media request *timeout*. So if you set the timeout to 1 hr, the email is sent at the *end* of the first hour and then the timer is reset once. (So a total of two hours before the script aborts.) You can modify the script to behave in a different fashion. I started to do this but have yet to get around to finishing it.

Link to comment
Share on other sites

Swell. So I have to wait for a full hour before getting notified? And then have an hour to put in a new tape.

On the other hand, if I set the timeout to 10 minutes, I get notified earlier but I have just 10 minutes to put in a tape. I may be out to lunch or whatever.

Isn't there an easy way around this?

Link to comment
Share on other sites

  • 2 weeks later...

Yes, that is unfortunately the choice you are left with when using the stock event handler. This thread got me thinking again about how to best modify the Retrospect Event Handler to get it to behave in a more reasonable way. Below is a first stab. I did this for the "legacy" handler for Eudora because that is what I use. I haven't looked at the others at all. I presume, though, that they just differ in how they talk to the mail program. If so, then these modifications should work just as well for them.

 

All these changes do is add another counter that lets the timer be reset more than once. Otherwise, it works just like the old handler. When there is a media request Retrospect starts the count-down timer for the amount of time set in the Retrospect preferences. When that times out the first time an email is sent warning that media is required. The timer is then reset. The next kMaxTimerResets number of times the timer runs out it will be reset but no additional email is sent. If there is no media by this number of resets, then the current operation aborts.

 

For example, if inside Retrospect you set the media request timeout to 10 min and inside the event handler you set kMaxTimerResets to 12, then when media is required Retrospect will wait 10 min, send an email, wait 12*10 min = 2 hr, then abort. Note that when Retrospect aborts the log will indicate it waited only 10 min for the media, but this is not correct.

 

I've tested this a little bit, but didn't see an obvious way to artificially induce a media request, so the testing has not been extensive. "Try it at your own risk" as the saying goes. grin.gif

 

Modifications to the standard Retrospect Event Handler for Eudora Light (in addition to the customization required to get the std handler to work):

 

1. At the beginning with all of the other "properties" and just *before* the line:

-- Nothing below this line needs to be edited.

 

add the lines (changing the 12 to whatever you prefer):

Code:


-- Set this property to the number of times to reset a media timeout before aborting

property kMaxTimerResets : 12


 

2. Add the variable gResetCtr to the line defining global variables, making this line read:

Code:


global gBackUpReport, gVolumeErrors, gNumVolumesBackedup, gStorageSet, gMediaRequestSent, gBackUpServerRunning, gTimeKeeper, gResetCtr

(this should be one line unless you break it and start the second with "global ..." again)

 

3. Rewrite the "on MediaRequestTimedOut" handler to look as follows. (The changes/additions are in lines 2, 7-8, 10, 12-14, and 19 below. Be careful of line breaks as I don't know how this will appear in a browser window.):

 

Code:


on mediaRequestTimedOut given numberOfSecondsWaited:theTimeOut

set theTimeOut to secondsConverter(theTimeOut * kMaxTimerResets)

if not gMediaRequestSent then

set theMsg to "Retrospect needs a " & theRequestedMediaType & " named \"" & theRequestedMember & "\"." & return & return & ¬

"Please provide this " & theRequestedMediaType & " or other appropriate media." & return & return & ¬

"You have " & theTimeOut & "to supply Retrospect with new media or the current operation will cease."

sendMail with sendNow given Subject:"Retrospect: Media Request", Message:theMsg, recipientsList:kMediaRequestGroup

sendMail without sendNow given Subject:"Retrospect: Media Request", Message:theMsg, recipientsList:kMainGroup

set gMediaRequestSent to true

set gResetCtr to 1

return false -- reset the media request

else if gResetCtr < kMaxTimerResets then

set gResetCtr to gResetCtr + 1

return false -- reset the media request

else

set gVolumeErrors to gVolumeErrors + 1

set gBackUpReport to gBackUpReport & ¬

"•Media request timeout occurred before script could successfully finish•" & return & return

return true -- already reset maximum number of times, so timeout.

end if

end mediaRequestTimedOut


 

The changes to lines 7 & 8 above (switching which has the "with SendNow" and which has the "without SendNow") has nothing to do with this modification of the behavior of the script. They are correcting what I believe to be a bug in the original script.

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...