How to automatic restart VPS every 5 mins ?

Discussion in 'Site & Server Administration' started by login, Dec 12, 2006.

  1. #1
    Where can I set this ? For testing purposes I want to have my VPS starting automaticly every 5 mins.

    Thanks.
     
    login, Dec 12, 2006 IP
  2. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #2
    make a shellscript

    
    #!/bin/sh
    reboot
    
    Code (markup):
    and have cron execute it every five minutes
     
    krakjoe, Dec 12, 2006 IP
  3. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yep...he hit the bull's eye!
     
    agnivo007, Dec 12, 2006 IP
  4. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #4
    Thanks krakjoe.
    I am new to this.

    ? Do I make a file called reboot.sh with the content:
    #!/bin/sh
    reboot

    should I cmod the file ?
    where do I place that file ?

    Thanks.
     
    login, Dec 13, 2006 IP
  5. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #5
    I made a file called autorestart with the content
    #!/bin/sh
    reboot
    I put it in etc/cron.hourly

    Thats all ?
     
    login, Dec 14, 2006 IP
  6. tanfwc

    tanfwc Peon

    Messages:
    579
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Put your autorestart file in /etc/cron.d and have this content added.

    Untested yet, because I am going out now.
     
    tanfwc, Dec 14, 2006 IP
  7. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #7
    Thank you all, it works now.
     
    login, Dec 15, 2006 IP