[SATLUG] small script, baffled problem.
e2eiod at gmail.com
Fri Aug 13 03:25:34 CDT 2010
On Thu, Aug 12, 2010 at 9:14 PM, Richard Suberg <rsuberg at satx.rr.com> wrote:
> Thanks, what I did was put the ; in there, then was able to take out the
> exit and put in an else clause...now to have the thing let me know when it
> fails (would be in the else clause) but how to do it? telnet to the mail
> server? This box just sits there serving documents, has apache loaded, but
> no external mail setups. I knew it was going to be something simple...
I am confused about whether you still have a problem so just ignore this if
For your case I would simply write the "else" exit status to a file or a
variable and write the value of that to the file and send that file, if it
exists to where the other files are going - need to check it is new and not
send old file. If you don't need a "status history record" then just
overwrite the same file name on the source end. "Status history records" are
good for repetitive tasks management.
What normally happens on remote unattended scripted processes is the "finish
status - good or bad" and any information you might feel is important over
and above status, like how many files sent, how long it took, etc., is
captured in a file and sent. Then a script on the destination end polls for
that "status file" and "if found newer than the previous one or today's
date, etc." emails it to you.
The polling script on your end also checks to see if that "new" file is
found within a reasonable time based on historical times If not it emails
you to check on the process...
So you either get the complete exit status or a warning that the process is
Try to make this code as generic as possible by setting variables at the
start of the script for "destination", "file name" "status", etc. That makes
this handy script easily re-usable for all kinds of things by just changing
the values of the variables and adding or deleting them as well.
More information about the SATLUG