Sample Header Ad - 728x90

Best way to follow a log and execute a command when some text appears in the log

66 votes
6 answers
111917 views
I have a server log that outputs a specific line of text into its log file when the server is up. I want to execute a command once the server is up, and hence do something like the following: tail -f /path/to/serverLog | grep "server is up" ...(now, e.g., wget on server)? What is the best way to do this?
Asked by jonderry (2109 rep)
Apr 26, 2011, 09:26 PM
Last activity: Oct 16, 2024, 10:00 PM