VanHlebar Posted April 10, 2007 Posted April 10, 2007 I need to create a cron job that will run a php file. I am completely ignorant to cron jobs so any assistance would be appreciated. Here is the example that was given to me from the documentation of WordPress: source-- *****/wp-content/plugins...ie/get_mail.php Thanks again for the help. -Eric Quote
TCH-Bruce Posted April 10, 2007 Posted April 10, 2007 The command you will want to use is: >/usr/bin/php -q /home/your-cpanel-id/public_html/path-to-php-to-run See the movie tutorial on setting up a cron job. Quote
VanHlebar Posted April 11, 2007 Author Posted April 11, 2007 Thanks Bruce for the help and for moving the thread to the correct spot. I am still getting not able to get this to work though. I followed the steps listed in the movie and used the code snippet you posted but it doesn't seem to be running. I am not even getting any kind of errors emailed to the email address that I am putting in the email field of the cron job page. If the job was kicking off some type of error I would expect it to at least email something to me. I also was under the impression that it should actually email something to me on failure or success. Any additional ideas? I know the php file is working correctly because when I type it into my web browser I get the desired results that I was expecting, so it isn't the php file. Thanks, -Eric Quote
TCH-Dick Posted April 11, 2007 Posted April 11, 2007 Hi Eric, You did nothing wrong. Bruce is going to kill me for this because I do it all the time, but he had a typo. I have corrected the example above and you just need to change /use/ to /usr/. Quote
TCH-Bruce Posted April 11, 2007 Posted April 11, 2007 Sorry Eric, I need to proof my posts better. Thanks Dick for spotting my error. Quote
VanHlebar Posted April 11, 2007 Author Posted April 11, 2007 Hey Guys, Thanks for the help. I had a few other issues also. I setup the script to run only at 5 past midnight so it wasn't going to run until then anyways. Then I didn't give myself executable privilage on the php file. So it appears all is working correctly now and your help is greatly appreciated.! -Eric Quote
TCH-Bruce Posted April 11, 2007 Posted April 11, 2007 Glad you got it sorted. However, I do not think you needed to change permissions on the php file for it to execute. I run php files from cron and I've never had to change permissions. Which Wordpress plugin are you using? Quote
VanHlebar Posted April 11, 2007 Author Posted April 11, 2007 Bruce, I am using the latest version of Wordpress along with the Postie Plugin that allows posting blogs via email. When it tried to execute it returned an error that permission was denied. Now it could have been because I had the script setup wrong, but when I looked at the permissions execute was not checked. I will try to uncheck it and see if it still works. -Eric Quote
TCH-Bruce Posted April 11, 2007 Posted April 11, 2007 Are you using the original author's version or the updated one found here? Quote
VanHlebar Posted April 11, 2007 Author Posted April 11, 2007 Are you using the original author's version or the updated one found here? I am using the updated one. I did change the permissions back on the php file and everything is still working, so it appears that my initial error was with the script. Go figure...told you I was a newbie. Thanks again for all your help! 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.