[ale] Perl script to check process
Tim Watts
tim at cliftonfarm.org
Mon Jan 9 11:50:28 EST 2012
Does it have to be Perl? It's simple enough to do in bash:
#!/bin/bash
while ((1)); do
if (ps -fe | grep -v "grep" | grep -P "\Wxboard\W??" >/dev/null); then
{your-start-invocation-here}
fi
sleep 30
done
Would need to refine that 2nd grep if you get more than one hit.
Alternatively, create a pid file when you invoke xboard and grep for
that pid.
On Mon, 2012-01-09 at 15:31 +0000, johnpollock at bellsouth.net wrote:
> Am hoping someone that knows perl can help..
>
> I have chess program I run as a bot, the program is called xboard.
>
> What I'm hoping to accomplish is acquire a perl script that would
> check if it is running and if not restart it.
>
>
>
> Thank you,
> JP
> Sent via BlackBerry by AT&T
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
Url : http://mail.ale.org/pipermail/ale/attachments/20120109/e95d0d01/attachment-0001.bin
More information about the Ale
mailing list