Jump to content

Cron Job


ablaty2

Recommended Posts

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

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

Guest Geoff

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

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...