1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CronJob

Discussion in 'General Scripting Chat' started by zx123, Feb 25, 2011.

  1. zx123

    zx123 Senior Member

    Joined:
    Feb 26, 2009
    Messages:
    1,162
    Likes Received:
    876
    Home Page:
    I have a php script that I want run every 65minutes
    how I can write the cronjob value?

    I opened /etc/crontab and add the following line but I think that this is wrong ;)
    Code:
    65 * * * * php /home/blabla/script.php
    please help me
     
  2. MrMan99

    MrMan99 Newbie

    Joined:
    Feb 23, 2011
    Messages:
    8
    Likes Received:
    0
    Code:
    65 * * * * /home/blabla/script.php
    Why do you have
    the PHP in front of the dir?
     
  3. zx123

    zx123 Senior Member

    Joined:
    Feb 26, 2009
    Messages:
    1,162
    Likes Received:
    876
    Home Page:
    Code:
    65 * * * * /home/blabla/script.php
    is wrong :)

    now I try
    Code:
    */65 * * * * php /home/blabla/script.php
    "php" is for run php code :)

    for example to run a shell script for restart webserver when down I use
    Code:
    */5 * * * * root /root/restartWEBscript.sh >/dev/null 2>&1
    
     
  4. cnick79

    cnick79 Jr. VIP Jr. VIP

    Joined:
    Jun 10, 2010
    Messages:
    653
    Likes Received:
    341
    Location:
    Google's SandBox
    I don't think 65 is a valid value?

    5 * * * * /path/script.php

    will tell cron to run every 5 minutes past the hour.
     
  5. MrMan99

    MrMan99 Newbie

    Joined:
    Feb 23, 2011
    Messages:
    8
    Likes Received:
    0
    I'm almost positive I don't have php infront of my cronjob on my server. When I get back on the work PC. I'll check it out. I'm prob wrong.