Scripts to check if a process is running
Hi All,
I am using Mandrake10.1. I am running amule all the time, but sometimes this program ended unexpectedly while I was away. How do I write a script to check if this process is running, if not run the process? How do I automatically run this script every hour? Thanks. |
There's a nifty tool called "pidof" that basically runs through and checks for a running serivce and returns the pid of it. It's the same as running ps aux | grep amule and nothing the pid of it. I'm no expert, but something like:
Code:
$service=0 |
Code:
#!/bin/bash |
Shows how good my bash scripting is - think I'll stick to PHP! Least I was along the right lines :-)
|
All times are GMT -5. The time now is 08:19 AM. |