CompileNix's Blog - Send mail when a specific text appers in log/text file

Start Page | RSS Feed | Find Stuff

tail -f /var/log/messages | awk '/printer on fire/ { system("date; doSomething & echo -e \"I've done something about it.\" | EMAIL=\"FromName <FromUser@example.com>\" mutt -s \"Printer on fire!\" \"ToName <ToUser@example.com>\"; wait;") }'