I would like to setup a Cron job to check weather X process is running

Results 1 to 3 of 3
  1. #1
    Member wemersonmelki is offline
    MemberRank
    Jan 2013 Join Date
    67Posts

    I would like to setup a Cron job to check weather X process is running

    I would like to setup a Cron job to check weather X process is running or not. if it is not running then start that X process with a log message....

    can any one help writing a script?

    thanks


  2. #2
    The Cat in the Hat cypher is offline
    MemberRank
    Oct 2005 Join Date
    IrelandLocation
    5,073Posts

    Re: I would like to setup a Cron job to check weather X process is running

    Sure, just set the cron jobs just like Chumpy does in the cabal tg script or generate them online.

    Also to find out if the process is running check it like this: ps -A | grep -q "ProcessName", check exit code of that command. If exit code is zero means that the process is still running. Then just start it by normally invoking it.

    As for logging just echo a string to a file using append. echo "test" >>" $filename".

    If you need more help let me know.

  3. #3
    Member wemersonmelki is offline
    MemberRank
    Jan 2013 Join Date
    67Posts

    Re: I would like to setup a Cron job to check weather X process is running

    I can send the command, I'm kind of new thing these do not quite understand

    excuse my english

    * * * * * /root/cabaldallas.txt

    can someone make a turotial here more or less with solution



Advertisement