captaincore/lib/remote-scripts/master-db-query
Austin Ginder 825b54016d 📦 NEW: Go CLI
2021-06-24 23:05:07 -04:00

13 lines
392 B
Bash
Executable file

#!/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)"