Check server status along with process id and specific text in log untill 5 minutes
Hi ,
I want to check the server status up and running . 1. Check based upon process id. 2. While checking status Grep specific text in log files untill 5 minutes ,else exit. 3. After start chek if starts or ot 4. After stop check if stops or not *******I am working below script*************************** Code:
case "$1"in |
Does that script work? If not, what happens?
(Please use [code] tags when posting code) |
Yes script works fine, here in status I want to check specific text in log file untill 5 minutes and if it can find then its runnng else stopped.
Status) if [ -n "$pid"] ; then echo "Server is running" |
What text and in which log file?
At that point, you know the process is running. If you want to stop it after 5 seconds, will sleep do? Code:
man sleep |
Please place your code snippets inside [CODE]...[/CODE] tags for better readability. You may type those yourself or click the "#" button in the edit controls.
It is unclear what you mean by this... Quote:
Please be more complete in your question, including which log and an actual example of the line you want to look for. Please review the Site FAQ for guidance in posting your questions and general forum usage. Especially, read the link in that page, How To Ask Questions The Smart Way. The more effort you put into understanding your problem and framing your questions, the better others can help! |
Edited code with readable format now .
|
# Here i want to check aso from log.txt for text "pogo Go" this takes 5 minutes to come in log.txt. If this condition is tur then only server is started.
|
Quote:
Again, please review the Site FAQ for guidance in posting your questions and general forum usage. Especially, read the link in that page, How To Ask Questions The Smart Way. The more effort you put into understanding your problem and framing your questions, the better others can help! |
Log file looks like this as below
I want my script to check for 5 minutes and search this string "POGO ready" . If it can find this string for 5 minutses else exit Code:
|
All times are GMT -5. The time now is 11:38 PM. |