ablaty2 Posted May 27, 2011 Share Posted May 27, 2011 I would like to run a cron job that simply runs (accesses) a php webpage. I tried: /usr/bin/wget http://geotours.heliohost.org/buImg1.php >/dev/null but it doesn't seem to be working (I get no email from the cron job and nothing from the script itself). Any ideas? is /usr/bin/wget correct? Also, is there anyway to test a cron job to make sure it is working Finally, is it OK if i have many cron jobs (more than 2/day) for a short period of time while I test and debug the script? Thanks, Alex Quote Link to comment Share on other sites More sharing options...
Guest Geoff Posted May 27, 2011 Share Posted May 27, 2011 Remove >/dev/null from your cron job and then see if you get an email. Quote Link to comment Share on other sites More sharing options...
Byron Posted May 28, 2011 Share Posted May 28, 2011 I've never used /usr/bin/wget to run a cron. I always use the full path like this: php -q /home/byron/public_html/files/cron.php Finally, is it OK if i have many cron jobs (more than 2/day) for a short period of time while I test and debug the script? Only if your not able to test the script by clicking onto the url. Quote Link to comment Share on other sites More sharing options...
Guest Geoff Posted May 28, 2011 Share Posted May 28, 2011 @byron wget calls your script from the web, php -q calls your script from the command line. It actually is better to use php -q (less overhead), but it's not that much of a difference. Quote Link to comment Share on other sites More sharing options...
Byron Posted May 28, 2011 Share Posted May 28, 2011 @byron wget calls your script from the web, php -q calls your script from the command line. Thanks Geoff! Quote Link to comment Share on other sites More sharing options...
ablaty2 Posted May 28, 2011 Author Share Posted May 28, 2011 I've never used /usr/bin/wget to run a cron. I always use the full path like this: php -q /home/byron/public_html/files/cron.php Finally, is it OK if i have many cron jobs (more than 2/day) for a short period of time while I test and debug the script? Only if your not able to test the script by clicking onto the url. I still can't get it to work. It (spurratically) sends me an email saying: --------------------------- Status: 404 Not Found X-Powered-By: PHP/5.3.3 Content-type: text/html No input file specified. ----------------------- First, what is the folder "files"? is it a folder on your account or do I need to have it in my URL also? Here is what I have so far for my two cron jobs: php /home/ablaty/public_html/buImg.php php /home/ablaty/public_html/buscript/buMySQL.php Both Files are viewable in the browser though http://geotours.heliohost.org/buImg1.php http://geotours.heliohost.org/buscript/buMySQL1.php They do take a second or 2 to load though... could it be timing out? Thanks, Alex Also, while I am trying to get these cron jobs to work, they seem to randomly disappear. When I try to edit one, sometimes it says: Could not find linekey=88d6b5c720cd3f10e427480ac648a9c5 Quote Link to comment Share on other sites More sharing options...
jje Posted May 28, 2011 Share Posted May 28, 2011 Are you sure your home directory is /home/ and not /home1/ ? Quote Link to comment Share on other sites More sharing options...
ablaty2 Posted May 29, 2011 Author Share Posted May 29, 2011 Are you sure your home directory is /home/ and not /home1/ ? That was the problem! Thanks! Quote Link to comment Share on other sites More sharing options...
jje Posted May 29, 2011 Share Posted May 29, 2011 Your welcome! Glad your problem got solved Please spare 2 minutes to fill in our quick survey: http://www.helionet.org/index/index.php?showtopic=8947 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.