Skip to content

Add --network flag for event run #117

@apermo

Description

@apermo

Feature Request

Describe your use case and the problem you are facing

In a multisite environment when you want to run wp cli cron, you end up with either:

*/5 * * * * /var/www/html/vendor/bin/wp cron event run --due-now --path=/var/www/html/web/wp/ --url=blog.company.tld/de/
*/5 * * * * /var/www/html/vendor/bin/wp cron event run --due-now --path=/var/www/html/web/wp/ --url=blog.company.tld/en/
*/5 * * * * /var/www/html/vendor/bin/wp cron event run --due-now --path=/var/www/html/web/wp/ --url=blog.company.tld/fr/
*/5 * * * * /var/www/html/vendor/bin/wp cron event run --due-now --path=/var/www/html/web/wp/ --url=blog.company.tld/it/
*/5 * * * * /var/www/html/vendor/bin/wp cron event run --due-now --path=/var/www/html/web/wp/ --url=blog.company.tld/nl/
*/5 * * * * /var/www/html/vendor/bin/wp cron event run --due-now --path=/var/www/html/web/wp/ --url=blog.company.tld/es/

A custom bash script or as best solution

wp site list --field=url | xargs -i -n1 wp cron event run --due-now --url="{}"
Credits: https://wordpress.stackexchange.com/a/349924

Describe the solution you'd like

While the suggestion from Stackoverflow is perfectly doint the job, this is rather complex and a small overhead.

I would love to just be able to run:

wp cron event run --due-now --network

This would be way cleaner than having n crons in the crontab, and cleaner and less overhead than the stackoverflow suggestion.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions