Re: Auto-email upon restart?
This WebDNA talk-list message is from 2001
It keeps the original formatting.
numero = 38515
interpreted = N
texte = >On 9/7/01 7:47 PM, Kenneth Grome
wrote:>>> WebCat does not offer an option to activate a trigger automatically>> when the program is restarted. Does anyone have an idea (or>> existing code) for how to make this happen? I simply want to receive>> an email message when webcat is restarted ... but I do not want to>> receive this message at any other time.>>>My winNT runs all the daily triggers whenever the machine starts up.>In fact I had to set things up so that it ignored everytime webcat crashed>and restarted itself. I was getting 3-5 crashes everyday and it would run>specialized routines that should have only run at 1 in the morning.>>You could set the trigger to run at 1:01 and then do a hideif [time] is>between 101 and 103. Its not perfect, but, its within 3 minutes a day.Thanks for the ideas, Bob. Given the fact that triggers should execute on time -- within the second -- the following code seems like it should work with a trigger set to run at 00:00:01 am every day (* * * 0 0 1). This code increases the precision of the messages being sent to a range of about 3 seconds.When webcat's trigger system sends a request for this file at 00:00:01, the first set of showif's allow the nested sendmail message to be sent, because the time is between 00:00:00 and 00:00:03. At the same time, the second set of showif's prevent the second message from being sent.But when this file is requested by a restart of webcat -- at any time except the few seconds during which the trigger requests this file -- the second message will be sent and the first one will not.This is just what I need: a system that tells me every day that the trigger is still working, and when the server is restarted at a time that's not within a few seconds of the trigger time, I will receive a different message telling me exactly when the server was restarted.Presumably the only time this solution will not work perfectly is when webcat is restarted during the few seconds between 00:00:00 and 00:00:03, because at this time it will not send me a 'server restart' message. But my need is not so critical that I have to be concerned about those few seconds.[showif [time]>00:00:00][showif [time]<00:00:03][sendmail to=owner@kengrome.com&from=Ken's Server&subject=Daily trigger activated at [time] --> emailOnRestart]This message confirms that the trigger I refer to as emailOnRestart is actually working every day like it is supposed to.[/sendmail][/showif][/showif][showif [time]<23:59:59][showif [time]>00:00:02][sendmail to=owner@kengrome.com&from=Ken's Server&subject=Server restarted at [time]]This message confirms that the server has restarted at some time of the day which does not fall between 00:00:00 and 00:00:03.[/sendmail][/showif][/showif]----------------------------------------------------Kenneth Grome & Associatesweb: http://kengrome.comemail: owner@kengrome.commobile: +63 917 254-1494office: +63 32 262-8164-----------------------------------------------------------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
>On 9/7/01 7:47 PM, Kenneth Grome wrote:>>> WebCat does not offer an option to activate a trigger automatically>> when the program is restarted. Does anyone have an idea (or>> existing code) for how to make this happen? I simply want to receive>> an email message when webcat is restarted ... but I do not want to>> receive this message at any other time.>>>My winNT runs all the daily triggers whenever the machine starts up.>In fact I had to set things up so that it ignored everytime webcat crashed>and restarted itself. I was getting 3-5 crashes everyday and it would run>specialized routines that should have only run at 1 in the morning.>>You could set the trigger to run at 1:01 and then do a hideif [time] is>between 101 and 103. Its not perfect, but, its within 3 minutes a day.Thanks for the ideas, Bob. Given the fact that triggers should execute on time -- within the second -- the following code seems like it should work with a trigger set to run at 00:00:01 am every day (* * * 0 0 1). This code increases the precision of the messages being sent to a range of about 3 seconds.When webcat's trigger system sends a request for this file at 00:00:01, the first set of showif's allow the nested sendmail message to be sent, because the time is between 00:00:00 and 00:00:03. At the same time, the second set of showif's prevent the second message from being sent.But when this file is requested by a restart of webcat -- at any time except the few seconds during which the trigger requests this file -- the second message will be sent and the first one will not.This is just what I need: a system that tells me every day that the trigger is still working, and when the server is restarted at a time that's not within a few seconds of the trigger time, I will receive a different message telling me exactly when the server was restarted.Presumably the only time this solution will not work perfectly is when webcat is restarted during the few seconds between 00:00:00 and 00:00:03, because at this time it will not send me a 'server restart' message. But my need is not so critical that I have to be concerned about those few seconds.[showif [time]>00:00:00][showif [time]<00:00:03][sendmail to=owner@kengrome.com&from=Ken's Server&subject=Daily trigger activated at [time] --> emailOnRestart]This message confirms that the trigger I refer to as emailOnRestart is actually working every day like it is supposed to.[/sendmail][/showif][/showif][showif [time]<23:59:59][showif [time]>00:00:02][sendmail to=owner@kengrome.com&from=Ken's Server&subject=Server restarted at [time]]This message confirms that the server has restarted at some time of the day which does not fall between 00:00:00 and 00:00:03.[/sendmail][/showif][/showif]----------------------------------------------------Kenneth Grome & Associatesweb: http://kengrome.comemail: owner@kengrome.commobile: +63 917 254-1494office: +63 32 262-8164-----------------------------------------------------------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Kenneth Grome
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Date and Time Math (1997)
ooops...WebCatalog [FoundItems] Problem - LONG - (1997)
Cart ID Duplication (2001)
RAM variables (1997)
WebCat2b13MacPlugIn - More limits on [include] (1997)
Multiple prices (1997)
[Sum] function? (1997)
Not reading blanks (1998)
[WriteFile] problems (1997)
Upgrading old WebCat Database Files (1997)
WebCatalog seems to choke on large (2meg) html files. (1998)
WebCat & WebTen (1997)
[WebDNA] WebDNA 7 64bits for OSX (2012)
Pithy questions on webcommerce & siteedit (1997)
Grep Master Needed (2003)
wrong input values? (1997)
[Announce] Newest Commerce Site based on WebCatalog (1997)
No messages for a week? (2000)
Currency Conversion (2003)
HELP WITH DATES (1997)