Basem
El Presidente
Just Getting Started
Member Likes (0)
Apparently there is a huge problem with wp-cron being spawned multiple times which will overload your server. Everywhere on the web is saying switch to the server cron instead. So I added define('DISABLE_WP_CRON', true) to the wp-config. My issue is how do I add the cron server? I tried add this /usr/bin/php /home/username/public_html/wp-cron.php, but I get an error saying:
Status: 302 Moved Temporarily
X-Powered-By: PHP/5.3.6
Location: http://mydomain.com/wp-signup.php?new=
Content-type: text/html
What is the correct way to do this for a multisite setup?
Responses (11)
Support Chimp (joined March 2010) Likes (0)
How are you adding that?
In cPanel? Some other way?
If in cPanel you can schedule the time and use this:
wget -q -O - http://yourwebsite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1If you are creating the crontab in say SSH and you wish to run it every hour of every day then you would add this instead:
5 * * * * wget -q -O - http://yourwebsite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1If your really stuck then it might be wise asking your host for a hand with this.
Take care.
Member (joined September 2011) Likes (0)
I am using CPanel. The issue is not adding the cron job, but how to do this for a multisite. Using your method implies I have to create a cron job for EACH site? That would be a management nightmare. Is there one entry that would handle all sites? I found this on GitHub, but is untested and not sure what it does: https://github.com/chibani/wp_multisite_cron . How does EduBlogs do this when they get sites added everyday. I am sure they do not create a cron job for each site. Thanks for any help.
Support Chimp (joined March 2010) Likes (0)
I was just doing a little research into this and find a few mixed posts.
I always thought it worked just fine, perhaps using the actual path instead might work.
But I see some people saying it doesn't always set all posts live in a multisite.
It looks like a plugin which can be installed to control network wide crons. I've never tested it though.
Take care.
Support Chimp (joined March 2010) Likes (0)
Just to add about Edublogs and how crons run there. I'm just checking on that with @S H Mohanjith who does a lot of work over there.
Thanks.
Member (joined September 2011) Likes (0)
I tried reading the code to the mentioned plugin and it seems to be looping through all the your site URL's and launching the cron for each. Seems reasonable. It is just concerning that it is not in the WordPress plugin repository and just in GitHub. I felt adventurous and installed it anyway. I am trying to test it out now using a scheduled post. I will let you know how it goes. It is telling me to add this to the cron. I am not sure what the -qO- flags mean though, or what www-data means either.
*/15 * * * * www-data /usr/bin/wget -qO- http://mydomain.com/wp-admin/admin-ajax.php?action=wp_multisite_cron_call
Support Chimp (joined March 2010) Likes (0)
Hey there.
The -q is quiet to stop the output of any data/files.
I think the O is output, so I think it will be quiet output.
Take care.
Member (joined September 2011) Likes (0)
The plugin doesn't work. I get an error 500. The error logs say something about ffmpeg not installed, but I think it is a misleading error message. I am surprised this is not a common need. I don't think many people realize this workaround for the WordPress bug would save them tons of CPU and memory usage. I happened to go down this path because the WordPress cron killed my server under high traffic. Turning off the WP cron brought my cpu from 18 to less than 2 under the same load! Any help would be greatly appreciated.
Member (joined September 2011) Likes (0)
{double post}
Member (joined September 2011) Likes (0)
bump
Member (joined September 2011) Likes (0)
I think I got it working and notified the author of the issues. I also forked the project here: https://github.com/basememara/wp_multisite_cron
Support Chimp (joined March 2010) Likes (0)
ffempeg relates to video, so I'm not sure how that would relate here.
That's awesome!
I saw a few other plugins which others may wish to look into should they stumble across this thread:
http://wordpress.org/extend/plugins/wp-cron-dashboard/
http://wordpress.org/extend/plugins/fff-cron-manager/
http://wordpress.org/extend/plugins/wp-cron-control/screenshots/
Take care.
WordPress Questions?
We've got answers!
Find out more »