Jump to content

Recommended Posts

Posted

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

Remove >/dev/null from your cron job and then see if you get an email.

Posted

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

@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.

 

 

Posted
@byron wget calls your script from the web, php -q calls your script from the command line.

 

Thanks Geoff! :)

 

Posted
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...