rklau Posted January 16, 2004 Posted January 16, 2004 Hi - I recently installed an RSS aggregator that is written in PHP and has a mySQL backend. (It's here if you want to check it out.) There's a way to automatically update all feeds using a page included with the app - called update-quiet.php. I should be able to schedule a cron job to run this page periodically, but for the life of me I can't figure out the right command. I thought it should be (in the entry for the command to execute via C-Panel's manage cron jobs): php /home/xxxxxxx/public_html/directory/update-quiet.php (When I run that w/e-mail notification enabled, I get a message that includes the headers of the php file, but it has not actually executed the script.) Any idea why that's not working? What should this look like? --Rick Tech blog Quote
DarqFlare Posted January 16, 2004 Posted January 16, 2004 This is how I run PHP through cron: >GET http://www.mysite.com/path/to/file.php Quote
schussat Posted January 16, 2004 Posted January 16, 2004 php /home/xxxxxxx/public_html/directory/update-quiet.php (When I run that w/e-mail notification enabled, I get a message that includes the headers of the php file, but it has not actually executed the script.) Hrm, tat's exactly the form of a php cron job that I run. I'm not sure in this case if the file's permission's matter, but it's worth checking; is the file set to execute? Does the script work properly if you run it through your browser (ie, pointing the browser to yourdomain/directory/update-quiet.php)? Checking that might help with troubleshooting. -Alan Quote
rklau Posted January 16, 2004 Author Posted January 16, 2004 Oddly enough, it does work when I execute directly, and the script's permissions were set properly. In any event, I followed the instructions to use "GET http://domain.com/path/to/file.php" and that is now working. Note: I have the directory this file is in password-protected, and to authenticate I'm actually using the URL: http://user:password@domain.com/path/to/file.php. Thanks for the help! Quote
DarqFlare Posted January 17, 2004 Posted January 17, 2004 (edited) Oh really? That authentication works for the cron job in a password-protected directory? I'm extremely happy to read that you can do that. I do believe that I will be adding that kind of protection to my cronned scripts! Thank you for your help as well, rklau! Edited January 17, 2004 by TCH-Robert Quote
spadin Posted May 13, 2005 Posted May 13, 2005 Sorry to bring up such an old topic, but it actually helped me. I was wondering, however, can I leave the email field blank so the script will not email me everytime it runs? Thanks, Sandro Quote
TCH-Andy Posted May 13, 2005 Posted May 13, 2005 Hi Sandro, Add >> /dev/null on the end of the cron line Quote
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.