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..
In reply to Re: Simple SMTP email within script...
by skx
in thread Simple SMTP email within script...
by jbodden
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |