Cronjob confusion


#1

I want to use the cronjob panel to run a php script on one of my subdomains. The script is named cron.php and I can run it manually from http://classifieds.purewaterandmore.com/cron.php

I simply do not understand how to fill in the cronjob at the panel to make it work. I have tried everything I found in the wiki and in the other users confusion.

Any help out there?


also visit my photoblog which still is at http://bodynsoul.shutterchance.com/


#2

Have you read this http://wiki.dreamhost.com/Crontab Please pay attention on give full path of PHP
If you follow the article, it should be quite straight forward to setup a crontab.

For example, if you want to run your cron.php file hourly.

  1. If you want to set it up from panel, in “type command to run” type command:
    /usr/local/php5/bin/php /home/youruser/classifieds.purewaterandmore.com/cron.php
    for php5 or
    /usr/local/bin/php /home/youruser/classifieds.purewaterandmore.com/cron.php
    for php4
  • read the article for full information
  1. if you want to create crontab in shell, type command:
    crontab -e
    0 * * * * /usr/local/php5/bin/php /home/youruser/classifieds.purewaterandmore.com/cron.php
    for php5 or
    0 * * * * /usr/local/bin/php /home/youruser/classifieds.purewaterandmore.com/cron.php
    for php4
  • read article for full information

The difference is that you do not need to key in 0 * * * * * at the panel. You select the option from the drop down menu

Save $97 (MAX Discount) with code: [color=#CC0000]97YES[/color] Sign Up NOW or More Codes Here


#3

If you can run it manually, then put this in the cron field in the Panel:
/usr/bin/curl classifieds.purewaterandmore.com/cron.php

And tell it how often you want it to run.

-Scott


#4

@patricktan

I had tried this already and it didn’t work.

But since one of course can never be sure not to have forgotten something I copied the command as you proposed, replaced youruser with my username (the one authorised for shell access.

I regret to tell you that it did not work, the cronjob did not happen :frowning:


also visit my photoblog which still is at http://bodynsoul.shutterchance.com/


#5

@sdayman

Have to admit also to you that I read your solution in another post yesterday and tried that also already, nevertheless, since I could have made a mistake, I tried it again just now.

No result :frowning:


also visit my photoblog which still is at http://bodynsoul.shutterchance.com/


#6

Bizarre. If you can run it “manually,” then curl should be just effective. What makes you think that running it manually worked, and that running it via curl didn’t work?

-Scott


#7

When I do http://classifieds.purewaterandmore.com/cron.php in my browser and then check the log file in my website, I find that the cronjob has been executed. When I wait for the curl to make it happen, it just doesn’t happen, I did it manually 19 hours ago and that is still the status in my log files.

I just checked it manually again and now it is updated to 7 seconds ago.


also visit my photoblog which still is at http://bodynsoul.shutterchance.com/


#8

Did you try the approach detailed in the DH Wiki article on running PHP from cron?

You might give that a try. :wink:

–rlparker


#9

Ohkee, I think I found it out. Using the cURL feature it actually worked, I had to use the following syntax though

/usr/bin/curl http://classifieds.purewaterandmore.com/cron.php

Pls notice the http:// before the classifieds.

It works, thanks for helping me out here


also visit my photoblog which still is at http://bodynsoul.shutterchance.com/


#10

Yep! That makes sense. Woo Hoo! I’m glad you got it working! :slight_smile:

–rlparker