Report this

What is the reason for this report?

Auto-restart process script.

Posted on March 2, 2014

Hello. I have a process, that i want to restart if he dies. Process name is black.x86 Directory - /tmp/blackplanet/black.x86 System - CentOS 6.4 Can someone help with correct .sh script? Thanks! PS. Yeah yeah i googled alot, but nothing helped me =(



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

put this on cron <br>if [ ! /usr/bin/pgrep black.x86 ];then /tmp/blackplanet/black.x86 & ;fi

I wrote this script like this <br># !/bin/bash <br> <br>if [ ! /usr/bin/pgrep murmur.x86 ]; <br>then /tmp/murmur/murmur.x86 &; <br>fi <br>Saved as watchdogblack.sh. <br>When i try to execute it error message appears: <br> <br>watchdogblack.sh: line 4: syntax error near unexpected token ;' <br>watchdogblack.sh: line 4: then /tmp/murmur/black.x86 & ; <br>

dont break the lines <br> <br>[code] <br>#!/bin.bash <br>if [ ! /usr/bin/pgrep black.x86 ];then /tmp/blackplanet/black.x86 & ;fi <br>[/code] <br>

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.