PDA

View Full Version : starting PHP file by CRON


hryan
06-30-2003, 01:31 PM
Hi, everibody!

I have searched most of the posts about CRON use, but I have not found clear answer:

What EXACTLY have to type as a command in CRON jobs if I need to execute a php file (i.e. proba.php)?

Thanks in advance!

Jeewhizz
06-30-2003, 02:20 PM
Try this:

php -q -f /home/username/public_html/folder/file.php

Jee

hryan
06-30-2003, 06:42 PM
THANKS Jeewhizz !!!

It is working!

But what about parameter -q ?

I have not seen it in PHP manual.

Jeewhizz
06-30-2003, 07:38 PM
i believe its to make sure it executes the file... I cna't remmeber off the top of my head, but remember that that is how to do it :)

Jason
06-30-2003, 07:47 PM
In /etc/crontab
* * * * * root run-parts /to/location/of/file/proba.php

where the *s represent the times. root represents the name of the user who executes the cron job. run-parts is for either executing an entire folder, NOTE: if not executing the entire folder then leave blank. and last command is the location to the folder or file to execute.


Jason

firepages
07-01-2003, 03:06 AM
the -q switch supresses http headers that php may otherwise send out , the php-cli does not require the switch if available (nor will it break by using it in the cli)

hryan
07-01-2003, 02:27 PM
Thanks all of you!

I use CRON by HTML-interface so me was interesting how to write a command to execute php.file from it

php -q -f /home/username/public_html/folder/file.php

is right one I can use, but I learned much more of this - THANKS!!!:)

Have a nice day!

Best regatrds, Hryan