[wp-trac] [WordPress Trac] #33994: Multisite cron from command line (eg. crontab)
WordPress Trac
noreply at wordpress.org
Thu Sep 24 16:30:12 UTC 2015
#33994: Multisite cron from command line (eg. crontab)
-------------------------+-----------------------------
Reporter: Grezvany13 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Cron API | Version:
Severity: normal | Keywords:
Focuses: multisite |
-------------------------+-----------------------------
For a project I'm working on we needed a way to run wp-cron.php for
multiple blogs on a network, while using crontab to run the cron at a
fixed interval.
However we found the issue that we not only had to call wp-cron.php for
every single blog, but also were forced to use either wget or cURL to make
sure every blog got called separately.
To fix this issue I've build a replacement for wp-cron.php, currently
called wp-cron-multi.php which allows us to have a single cron (in
crontab), but checks all transients on all blogs which are active.
It does allow/require some arguments, so it works perfectly in multiple
situation (like usage of $_SERVER['HTTP_HOST'] and custom path to the WP
core).
Personally I think this would be a nice addition to the WP core, either to
replace the current wp-cron.php file or as an addition to the current
method.
A gist with the code can be found at
https://gist.github.com/Grezvany13/35384a7855d544c7fed7
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33994>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list