Simple script - check if program is running
Hi, I have small problem, I have a server with ssh access (RSA keys authentication - so without password). I need a check on small period of time, if a specific program is running - if not - run it in screen.
It may be a simple bash script which I could put in my crontab. Anybody can help me ? I read a topic: http://www.linuxquestions.org/questi...unning-383958/ but I don't have an idea, how to use it with ssh, because I can't run it on that server. Sorry for my poor English. |
You could gin up a quick script to run "ps -A" then grep <STDOUT> for the name of the program you are looking for.
David |
Any example ?
I would be glad :) |
Code:
! pgrep someprogram &>/dev/null && screen -s /path/to/someprogram |
All times are GMT -5. The time now is 08:58 PM. |