Created
November 19, 2010 15:55
-
-
Save dkubb/706679 to your computer and use it in GitHub Desktop.
Sends an email to an address when a log is written to
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tail -0f test.log | ruby -ne 'open("|mailx -s Log [email protected]", "w", &:print)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'll post an explanation of what this is doing shortly. It may look simple, but there are actually a few subtle things going on here that are not immediately clear.