-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
Description
Feature Request
- Yes, I reviewed the contribution guidelines.
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.
michakrapp and florian-rieder