captaincore/lib/remote-scripts/master-db-query
Austin Ginder 50fdc309be 📦 NEW: Refactor
2026-02-28 22:03:50 -05:00

13 lines
392 B
Bash

#!/usr/bin/env bash
#
# Export select ids from CaptainCore CLI master
#
site_ids_to_sync=$@
function join_by { local IFS="$1"; shift; echo "$*"; }
site_ids=$(join_by , ${site_ids_to_sync})
cd ~/.captaincore/data/
wp db export - --no-create-info=true --tables=wp_posts --where="ID in ($site_ids)"
wp db export - --no-create-info=true --tables=wp_postmeta --where="post_id in ($site_ids)"