Need help for CCcamCheck.sh and crontab -e

There is 1 reply in this Thread which was already clicked 2,805 times. The last Post () by EDWINX.

  • Hello,


    I am setting up a CCcamCheck.sh script, if i start the script i get this back:


    Code
    cd /var/script
    then i am in the directory
    if i do ./CCcamCheck.sh
    i get back cccam.... ok


    i was wondering of the script i used is correct can someone check it? it need to restart the CCcam if it is stoped or is frozen


    Bash
    #!/bin/sh
    PID=`ps -ef|grep /usr/local/bin/CCcam|grep -v grep|wc -l`
    if [ $PID -eq 0 ]; then
    echo "cccam... down"
    echo "restart.. cccam"
    /usr/local/bin/CCcam &
    else
    echo "cccam... ok"
    fi


    if i do: crontab -e


    i get this code:


    Code
    */1 * * * * /var/script/CCcamCheck.sh >>/var/script/log/CCcamCheck.log 2>&1


    and i can see in the CCcamCheck.log this:


    cccam... ok
    cccam... ok
    cccam... ok
    cccam... ok
    cccam... ok
    cccam... ok
    cccam... ok
    cccam... ok
    cccam... ok


    So the script is working, the question that i also have is that i would get a time stamp and date in the logfile, who can help?

  • I have it! You can setup this in the CCcamCheck.sh


    Bash
    #!/bin/sh
    PID=`ps -ef|grep /usr/local/bin/CCcam|grep -v grep|wc -l`
    if [ $PID -eq 0 ]; then
    echo "cccam... down : $(date)"
    echo "restart.. cccam : $(date)"
    /usr/local/bin/CCcam &
    else
    echo "cccam... ok : $(date)"
    fi


    then you can see in the log file:



    cccam... ok : ma feb 28 13:45:01 CET 2011
    cccam... ok : ma feb 28 13:46:01 CET 2011

CCcam Support Forum

Configs, discussion, downloads and guides for CCcam Softcam.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!