• Resolved elkrat

    (@elkrat)


    Hope this helps someone. One little twist for me was that php8.5 had been recently installed on my system and thereby became the default version for my system command line, but I had php8.4 running WP and configured how I like. To change it back to 8.4 I had to remove the symbolic link to php that was in /etc/alternatives with rm php and then restore a proper one using ln -s /usr/bin/php8.4 php

    I have almost 400 blogs and maybe half of them are disabled, so I opted to create an array of my good ones and loop over it:

    #!/bin/bash

    blogs=(
    28
    37
    99
    140
    )

    for i in "${blogs[@]}"
    do
    echo _______________________________________________________________________
    echo "**** Blog $i ****"
    wp index-mysql enable --all --blogid=$i --path="/usr/share/nginx/mysitedir" --allow-root
    echo _______________________________________________________________________
    echo ""
    echo ""
    done

    If you look up bash script instructions, you can modify this concept and create a numeric loop that attempts to update every blog sequentially. The script fails gracefully – I just didn’t want to wait for 30% failures.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author OllieJones

    (@olliejones)

    Thanks for this!

    Something like this works too.

    wp site list --field=blog_id | \
    xargs -I % wp index-mysql --blogid=% enable --all --dry-run

    Thread Starter elkrat

    (@elkrat)

    That’s even nicer. You don’t have to maintain an array of blogs in the script. Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.