f



cron jobs in PHP admin to run a PHP file

I want to run a php script every day.  The page goes to a directory
and
parses a file and adds data to the database.  Where it says "command"
in cron jobs I don't know what it is looking for?  Can I put the name
of my php file?

This is what I have:

Minute    Hour   Day       Month       Weekday               Command
1              8     1-7          1-31
*                      myPage.php

The reason I am asking is I don't have a clue what PHPadmin wants in
the command box.  All I want to do is run the php script.

Thanks,
janis


0
jlrough (485)
5/27/2008 6:17:56 PM
comp.lang.php 32646 articles. 0 followers. Post Follow

5 Replies
1166 Views

Similar Articles

[PageSpeed] 1

JRough wrote:
>I want to run a php script every day.  The page goes to a directory
> and
> parses a file and adds data to the database.  Where it says "command"
> in cron jobs I don't know what it is looking for?  Can I put the name
> of my php file?
>
> This is what I have:
>
> Minute    Hour   Day       Month       Weekday               Command
> 1              8     1-7          1-31
> *                      myPage.php
>
> The reason I am asking is I don't have a clue what PHPadmin wants in
> the command box.  All I want to do is run the php script.
>
> Thanks,
> janis

usually you would put the path to the php interpreter followed by any 
required options followed by the script file name 


0
paul.lautman (522)
5/27/2008 6:32:46 PM
On May 27, 12:17 pm, JRough <jlro...@yahoo.com> wrote:
> I want to run a php script every day.  The page goes to a directory
> and
> parses a file and adds data to the database.  Where it says "command"
> in cron jobs I don't know what it is looking for?  Can I put the name
> of my php file?
>
> This is what I have:
>
> Minute    Hour   Day       Month       Weekday               Command
> 1              8     1-7          1-31
> *                      myPage.php
>
> The reason I am asking is I don't have a clue what PHPadmin wants in
> the command box.  All I want to do is run the php script.
>
> Thanks,
> janis

You will want something like
01  8  *  *  *  /usr/bin/php /<full_path>/myPage.php

I believe this will run daily at 8:01 and it will execute your php
page.
0
5/27/2008 6:37:41 PM
JRough wrote:
> I want to run a php script every day.  The page goes to a directory
> and
> parses a file and adds data to the database.  Where it says "command"
> in cron jobs I don't know what it is looking for?  Can I put the name
> of my php file?
> 
> This is what I have:
> 
> Minute    Hour   Day       Month       Weekday               Command
> 1              8     1-7          1-31
> *                      myPage.php
> 
> The reason I am asking is I don't have a clue what PHPadmin wants in
> the command box.  All I want to do is run the php script.
> 
> Thanks,
> janis
> 
> 

The program needs to be your PHP CLI executable.  Parameter should be
   -f <your script filename>

(You can leave out the -f - but I leave it in for clarity).

Ensure the cron user has permission to execute your php executable and 
read access to the script (plus the appropriate access to any other 
resources required).


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
jstucklex (14659)
5/27/2008 6:40:24 PM
On May 27, 11:32 am, "Paul Lautman" <paul.laut...@btinternet.com>
wrote:
> JRough wrote:
> >I want to run a php script every day.  The page goes to a directory
> > and
> > parses a file and adds data to the database.  Where it says "command"
> > in cron jobs I don't know what it is looking for?  Can I put the name
> > of my php file?
>
> > This is what I have:
>
> > Minute    Hour   Day       Month       Weekday               Command
> > 1              8     1-7          1-31
> > *                      myPage.php
>
> > The reason I am asking is I don't have a clue what PHPadmin wants in
> > the command box.  All I want to do is run the php script.
>
> > Thanks,
> > janis
>
> usually you would put the path to the php interpreter followed by any
> required options followed by the script file name

SO the php interpreter would be normally be in my http docs somewhere
under where I installed php
but this server is web hosted so I'm assuming it is the url I use to
run the scirpt in my browser.
thanks,
0
jlrough (485)
5/27/2008 7:41:24 PM
JRough wrote:
> On May 27, 11:32 am, "Paul Lautman" <paul.laut...@btinternet.com>
> wrote:
>> JRough wrote:
>> >I want to run a php script every day.  The page goes to a directory
>> > and
>> > parses a file and adds data to the database.  Where it says
>> > "command" in cron jobs I don't know what it is looking for?  Can I
>> > put the name of my php file?
>>
>> > This is what I have:
>>
>> > Minute    Hour   Day       Month       Weekday
>> > Command 1              8     1-7          1-31
>> > *                      myPage.php
>>
>> > The reason I am asking is I don't have a clue what PHPadmin wants
>> > in the command box.  All I want to do is run the php script.
>>
>> > Thanks,
>> > janis
>>
>> usually you would put the path to the php interpreter followed by any
>> required options followed by the script file name
>
> SO the php interpreter would be normally be in my http docs somewhere
> under where I installed php
> but this server is web hosted so I'm assuming it is the url I use to
> run the scirpt in my browser.
> thanks,

You assume incorrectly. Your hosting company should tell you what the path 
is (it is usually the path that BravoFoxtrot mentioned). They may have it in 
a faq somewhere. 


0
paul.lautman (522)
5/27/2008 7:44:18 PM
Reply: