Cron Question

Status
Not open for further replies.

hitster4

New Member
Messages
8
Reaction score
0
Points
0
Is it possible to run cron jobs in this format
*/5*** php http://endzoneffl.x10hosting.com/phpffl/program_files/autorun/myffl/schedules.php?Autorun_Pin=XXXXX

Or can I use Lynx like this.
*/5 13-23 * * Sun lynx -dump http://endzoneffl.x10hosting.com/phpffl/program_files/autorun/myffl/schedules.php?Autorun_Pin=xxxx

The problem is that it don't let me add arguments.
I use
*/5*** php http://endzoneffl.x10hosting.com/phpffl/program_files/autorun/myffl/schedules.php
and it complains about my autorun_pin not being there but when I add it like this
*/5*** php http://endzoneffl.x10hosting.com/phpffl/program_files/autorun/myffl/schedules.php?Autorun_Pin=XXXXX

I get file not found.

Thank You

Bob
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
The problem is that it don't let me add arguments.

I think the way to run your program is use wget:

Code:
*/5***  wget -q  [URL="http://endzoneffl.x10hosting.com/phpffl/program_files/autorun/myffl/schedules.php?Autorun_Pin=XXXXX"][COLOR=#0000ff]http://endzoneffl.x10hosting.com/phpffl/program_files/autorun/myffl/schedules.php?Autorun_Pin=XXXXX[/COLOR][/URL]

Your arguements are in the form of a query string, so the cron job has to call the webpage, not just invoke a script.

PS: Remember, no more than one cron job every 5 minutes.
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
The -q switch makes it run silently.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
What about:
Code:
*/5 13-23 * * Sun QUERY_STRING=Autorun_Pin=XXXXX php /home/hitster4/public_html/phpffl/program_files/autorun/myffl/schedules.php
(after changing "/home/hitster4" to your actual home directory)

Edit: Nevermind. Apparently, the CLI version of PHP5 no longer parses the QUERY_STRING environment variable. Two alternatives to using wget or curl are to parse QUERY_STRING yourself if $_GET is empty, or to parse $argv if $_GET is empty. wget/curl is easier.
 
Last edited:
Status
Not open for further replies.
Top