Closed Nikschavan closed 8 years ago
Thank you so much for this!
@lesterchan any plans when this will be released on WordPress repo?
I normally update my plugins with the next release of WP, in this case will be 4.6 =)
If I now run wp sweep --all
on a cron, is there no need to run wp db optimize
anymore? Is the database optimize that wp-sweep performs the same as the one built into wp-cli?
Thanks.
@collinbarrett yes, wp sweep -- includes optimize.
@lesterchan perfect. can't wait for the wp-cli support to be rolled out through the .org plugin repo!
I just manually installed the latest code (couldn't wait for the release). wp-cli integration seems to work like a charm. Thanks so much!
Hi, @Nikschavan, I would require a Feature.
wp sweep --all
doesn't consider the DB of a multisite.
Kindly may you add the feature to use it also for a multisite that has several websites with just 1 DataBase, then with some core tables in common and other tables that are repeated for each site?
I have 1 multisite with 2 sites the DB has different table prefixes for the 2 sites.
Please, may you do this?
Here my Feature Request that I wrote on the Support Page of the Plugin: https://wordpress.org/support/topic/wp-cli-on-a-multisite-with-1-data-base-and-2-different-table-prefixex/#post-10393725
Kind regards
G. Aloe
Hi @jscmal, There's a trick to run all the WP-CLI commands on MS -
wp site list --field=url | xargs -n1 -I % wp --url=% sweep --all
@danielbachhuber has a blog post which explains this nicely - https://danielbachhuber.com/tip/run-wp-cli-command-wordpress-multisite/
Thank you @Nikschavan. :) It works concretely well. I have to say that I had never used xargs before.
Now I have my script in cron that clean everything after the midnight backup.
First pass at #17, suggestions welcome :)