ablaty2 Posted May 27, 2011 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
Guest Geoff Posted May 27, 2011 Posted May 27, 2011 Remove >/dev/null from your cron job and then see if you get an email.
Byron Posted May 28, 2011 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.
Guest Geoff Posted May 28, 2011 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.
Byron Posted May 28, 2011 Posted May 28, 2011 @byron wget calls your script from the web, php -q calls your script from the command line. Thanks Geoff!
ablaty2 Posted May 28, 2011 Author 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
jje Posted May 28, 2011 Posted May 28, 2011 Are you sure your home directory is /home/ and not /home1/ ?
ablaty2 Posted May 29, 2011 Author Posted May 29, 2011 Are you sure your home directory is /home/ and not /home1/ ? That was the problem! Thanks!
jje Posted May 29, 2011 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now