Mailinglist Archive: opensuse (4570 mails)
| < Previous | Next > |
Re: [SLE] Script to check if an application is running
- From: Patrick Shanahan <ptilopteri@xxxxxxxxx>
- Date: Thu, 17 Nov 2005 14:40:49 +0000 (UTC)
- Message-id: <20051117144020.GM25976@xxxxxxxxxxxxxxx>
* Albert <albert@xxxxxxxxxxxx> [11-17-05 02:42]:
> I want to write a bash script which can be executed by cron every minute to
> check if an application is running. If it is not running the script should
> start it again.
make a script as:
#!/bin/bash
if ! (pidof -x <app-name>); then
/<path>/<to>/<app-name>&
fi
call the script from cron
*/5 * * * * /<path>/<to>/<script-name> > /dev/null
--
Patrick Shanahan Registered Linux User #207535
http://wahoo.no-ip.org @ http://counter.li.org
HOG # US1244711 Photo Album: http://wahoo.no-ip.org/gallery2
> I want to write a bash script which can be executed by cron every minute to
> check if an application is running. If it is not running the script should
> start it again.
make a script as:
#!/bin/bash
if ! (pidof -x <app-name>); then
/<path>/<to>/<app-name>&
fi
call the script from cron
*/5 * * * * /<path>/<to>/<script-name> > /dev/null
--
Patrick Shanahan Registered Linux User #207535
http://wahoo.no-ip.org @ http://counter.li.org
HOG # US1244711 Photo Album: http://wahoo.no-ip.org/gallery2
| < Previous | Next > |