Skip to content

Instantly share code, notes, and snippets.

@kamoljan
Created August 7, 2022 08:37
Show Gist options
  • Save kamoljan/eff09324a577929760a82d9bb5431441 to your computer and use it in GitHub Desktop.
Save kamoljan/eff09324a577929760a82d9bb5431441 to your computer and use it in GitHub Desktop.
Run mosql concurrently in bash
#!/usr/bin/env bash
set -euo pipefail
MAP=('Collection1.yml' 'Collection2.yml' 'Collection3.yml')
for m in "${MAP[@]}"
do
mosql -c "./collection/${m}" --sql "${MOSQL_POSTGRESQL}" --mongo ${MOSQL_MONGODB} --only-db "${MOSQL_DB}" &
done
wait
echo "Stopped!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment