The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cron Job

Discussion in 'General Discussion' started by jcallery, Aug 25, 2004.

  1. jcallery

    jcallery Well-Known Member

    Joined:
    Aug 25, 2003
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    What would i do if I wanted to setup a cron job for a simple php script?

    If my script was in /home/blah/public_html/php/file.php - what command would I use as the "Command to run"?


    Thanks!
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    The command would be:

    php -q /home/username/public_html/script.php

    using the correct path and script name.
     
  3. classca

    classca Registered

    Joined:
    Aug 14, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    To run any script command

    To run any script would The command be:

    /home/username/public_html/script.php the script path only ?

    using the correct path and script name.
     
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    For a perl script all you need is the path and file name, but for php you need to start off with the php -q. That's what I found out a while back when I set my first php cron job. It wouldn't work the way I always set up my perl scripts, so I searched here and found the problem.
     
  5. markd

    markd Registered

    Joined:
    Dec 21, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    ok Im new to this and finally found some of the statement you are all using.

    my question is /home/... the word home or the url address?


    I'm using
    php -q /home/???/public_html/featautodel.php

    I get 'no input file specified' in the sent email.

    suggestions please




    many thanks :)
     
    #5 markd, Dec 24, 2004
    Last edited: Dec 24, 2004
  6. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    That means the script is running, so the cron job is set right, but it sounds like the script is looking for input.

    I'm not sure how input can be provided by a cron job. Maybe the script can be modified to include what it wants.
     
Loading...

Share This Page