how to reboot server

There are 15 replies in this Thread which was already clicked 1,249 times. The last Post () by master G.

  • yes i know a bit how to creat a crontab but i like to clear some thing as last time when i add oscam.check script which is running every 5 minut.i login putty and write this command
    vi /etc/crontab


    and i found some cronjobs already there and i add my new command to run every 5 minut.


    but now i like to add sysytem to reboot every sunday , which command do i need to type?


    vi /etc/crontab
    OR
    crontab -e

    when i type crontab -e its a empty page so far.


    and what will be the command look like? i made this 30 2 * * 0 reboot
    is that ok?

  • please double check that is this way is also OK or not?



    I think if i want to reboot the system whenever it reaches seven days uptime..
    First, i will create a new script, shell script, run:


    Code:
    nano /bin/RestartMe


    Code:
    #!/bin/bash


    up=$(/usr/bin/uptime | cut -c14-19)


    if [[ '$up' = '7 days' ]]; then
    /sbin/shutdown -r +2
    fi


    exit 0


    # ENDAnd, then close and save the file and chmod 755 /bin/RestartMe, now i will setup a cronjob to run every night:


    To open crontab editor:
    Code:
    crontab -e and add


    30 2 * * * /bin/RestartMe
    Summary:
    The crontab i sat above, will run the script every night at 2:30 AM server time, thus the script will check for the server uptime, if it's 7 days, a system reboot will be fired.
    The reboot command will wait 2 minutes before doing the real reboot, this way it gives a chance for any logged user to finish any running work.


    Otherwise, if i want to reboot the system on Sunday after 2 after midnigh (Monday Early Morning), no matter how long is the uptime.. go like:


    Code:
    crontab -e and add
    30 2 * * 1 /bin/RestartMe


    i have not check this script yet but if some one please update us if its work.

  • Hello friends! I have set up a server, but I can’t use it because it goes down every night 3_56. I have tried to use Oscam_Status_Check_Script, but it not work. I don’t now what is wrong. I put it in var/skript. It is right?
    #!/bin/sh
    #
    FOO=”/tmp/_tmp”
    LOGIN=”root”
    PW=”pappa”
    IP=”192.168.1.90”
    PORT=”8080
    STR=”TITLE>”
    #
    curl -s –digest -o – -u $LOGIN:$PW “http://$IP:$PORT/status.html?hideidle=0? | grep “$STR” > $FOO
    printf “Checking for ERRORS …\n”;
    if [ -s $FOO ]; then
    printf “\033[37;32mOscam working OK\033[37;40m\n”;
    else
    printf “\033[37;31mOscam ERROR!\033[37;40m\n”;
    /usr/local/bin/oscam -b > /dev/null
    fi
    rm -f $FOO
    exit 0


    Is this right? Regards POS:still_dreaming:

  • what exact did you set up? oscam its own, oscam&cccam?
    as many of auto cccam install script has these script where every night ccccam stop 3:56am to update etc.............
    follow this tut it should work as i do for me.
    How to: Oscam stop/start script + anti-crash monitor


  • Pos,


    I've been experimenting with 3 or 4 different scripts like this over the past week....none of them work unfortunately!! I haven't been able to check the one you are considering using as I only have a Vu+ box which doesn't (AFAIK?) have Curl installed...


    you just need to save the file in your script directory, give it 755 permissions and setup a cron job to run every x minutes...

  • what exact did you set up? oscam its own, oscam&cccam?
    as many of auto cccam install script has these script where every night ccccam stop 3:56am to update etc.............
    follow this tut it should work as i do for me.
    How to: Oscam stop/start script + anti-crash monitor


    Must check that out myself cheers!


    edit - looks a bit more promising! I guess I'll see after a week!!

  • Hello again! You just need to save the file in your script directory, "give it 755 permissions and setup a cron job to run every x minutes..." Perhaps it is this that is wrong with my script? What must I do to let it check every 5 minute? Regards POS

  • Hello again! Here is what is written in Oscam.log when it stop.( 2011/12/17 3:56:01 0 s thread B774A6C0 exit with signal 15
    2011/12/17 3:56:01 0 s cardserver down)
    This happen every night. Any ideas abaut my problem? regards POS

  • Hello friends! I still struggle with this server, its stop every night 3, 56. It was written that it update every night in that time, so maybe I must just switch of update then. I have search for an explanation who to switch of update, but it is not easy for a windows man. Any who have an easy way to do it? Regards and Happy New year from POS

    • Official Post

    To change the time edit the file /ect/crontab,


Participate now!

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