FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Why doesn't my cronjob work?





Stubru Freak
I want it to execute a php file.
The URL of the file is http://battleschool.frih.net/admin/cronjobs.php

I used this line for the cronjob:
Code:
/usr/bin/php -q /home/stubrufr/domains/battleschool.frih.net/public_html/admin/cronjobs.php


Why doesn't it work?
When I open the URL in my browser it does work.
ChrisCh
Possibly because the URL is password protected. How can anyone help you if we can't access the page in question? Razz
Daniel15
ChrisCh wrote:
Possibly because the URL is password protected. How can anyone help you if we can't access the page in question? Razz

I don't think cron jobs can access password protected pages.
If you don't want anyone else accessing the cron job, the just put the PHP file outside your web root. For example, move the PHP file to /domains/battleschool.frih.net/cronjobs.php, and then use:

Code:
/usr/bin/php -q /home/stubrufr/domains/battleschool.frih.net/cronjobs.php


Nobody will be able to access the file via a web browser, but it will still work

Another method is checking to see if a cron job is running the script, or a browser. If it is a browser, don't let them in. There are numerous ways to do this, but the best way is to check for a remote IP (cron doesn't set a remote IP) I can tell you how to do this, if you want.
Stubru Freak
daniel15 wrote:
Code:
/usr/bin/php -q /home/stubrufr/domains/battleschool.frih.net/cronjobs.php


Doesn't work for some reason, altough cronjobs.php is in that folder.
I'm on server 2 (.frih.net)
Related topics
Why doesn't the page works
How to Work Out Smarter, Not Harder
Why Some Riot and Some Do Not
How can I change the caption of Browse button?
10 Reasons why PC's crash
My domain doesn't work
Visual Basic Tutorial - Control Arrays: What, Why and How
Why this code dont work ?
Is Adam really the first human in our world?
Mozile Firefox: ENTER in url bar doesn't work
Problem in Div with IE
mail()
the get_file_contents function doesn't work anymore
Internet Explorer the only browser that doesn't work on XP
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.