Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Simple SMTP email within script...

by skx (Parson)
on Jun 08, 2008 at 10:41 UTC ( #690910=note: print w/ replies, xml ) Need Help??


in reply to Simple SMTP email within script...

If you only care about whether a given string exists in a logfile, and send a mail if so then you might find a shell script to be sufficient?

#!/bin/sh if ( grep "pattern" /var/log/log.file 2>/dev/null >/dev/null ); then hostname | mail -s "Backup failed" some.email@example.com fi

Of course if you want to learn perl, or if your requirements change, then you could come back to it..

Steve
--


Comment on Re: Simple SMTP email within script...
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://690910]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2015-07-03 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (56 votes), past polls