33

I have WordPress Multisite with several sites. I set up DISABLE_WP_CRON to true in my wp-config.php.

If we set up cron task with wget or curl we have 30 sec rule to execute PHP script. It's so small to send tons of email notifications and do other stuff (maybe remote SMTP server connection is slow, maybe it's really huge bunch of email notifications from bbPress or anything).

Maybe we can use something like this?

php -q wp-cron.php

But it's only run cron to one site in Multisite (each site have their own cron tasks in different MySQL tables).

P. S. On wpmudev.org forum I found strange "solution" which also use Curl.

Another P. S. WP CLI have awesome wp cron commands but it's only allow run cron tasks manually (yep, we can use --url attr). For example:

wp cron event list --url=multisite.com
wp cron event list --url=subdomain.multisite.com
7
  • Have you taken a look at WP-CLI core code? Commented Nov 3, 2014 at 1:36
  • Yes. I dig into the source code right now and trying to understand :) Command to run all tasks (events) not exists, maybe I can create it in future. Commented Nov 4, 2014 at 13:27
  • Do you have wp/WP-CLI in your PATH? If yes, why not trigger that from a bash file running in cron? Commented Nov 4, 2014 at 13:38