Need help with a cron job

Discussion in 'Apache' started by greenstar91, Jul 12, 2007.

  1. #1
    I need a script that will reboot my vps every hour and I need to find a cgi or other similar script to be called from the cron:

    30 * * * *

    Can someone suggest anything?
     
    greenstar91, Jul 12, 2007 IP
  2. Fireproof

    Fireproof Peon

    Messages:
    265
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    While we are talking about Cron Jobs, I could use a script that copies a file from a low level directory in my site to the root.

    Assume the file is here: http://www.mysite.com/folder1/folder2/xxx.gzip

    And I want it here: http://www.mysite.com/xxx.gzip

    And I want that to happen every night (because a new file gets overwritten in the lower folder every day).

    Can anyone help? I know nothing about this.
     
    Fireproof, Jul 12, 2007 IP
  3. greenstar91

    greenstar91 Guest

    Messages:
    221
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hey go and get your own thread
     
    greenstar91, Jul 12, 2007 IP
  4. clixxer

    clixxer Peon

    Messages:
    47
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    30 * * * * root /sbin/reboot
    Code (markup):
    should do for a normal server, replace with whatever you need for the vps.
     
    clixxer, Jul 13, 2007 IP
  5. glowdot

    glowdot Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    One simple way to do this is to write a PHP script that does what you want it to do, and then execute that script in cron

    
    30 * * * * php /home/me/myscript.php > /dev/null
    
    Code (markup):
    Especially if you are doing something as simple as copying files, you would be better off spending a couple minutes writing your own rather than trusting someone else's script.
     
    glowdot, Jul 16, 2007 IP