diff --git a/dump.sh b/dump.sh index 4f469df..06880ef 100755 --- a/dump.sh +++ b/dump.sh @@ -1,8 +1,7 @@ -```sh #!/bin/bash # Configuration -KEYSPACE="dev_keyspace" +KEYSPACE="dev_keyspace_1" LOCAL_DIR="data/dumps" NODES=("cass-dev-01" "cass-dev-02" "cass-dev-03") SSH_USER="alfredo.oliviero" @@ -36,13 +35,14 @@ snapshot_and_copy() { done } -# Export keyspace schema from the first node -echo "Exporting keyspace schema for $KEYSPACE from ${NODES[0]}" -ssh $SSH_USER@${NODES[0]} "$CQLSH $CQLSH_IP -e \"DESCRIBE KEYSPACE $KEYSPACE;\"" > data/dev_keyspace_schema.cql - # Create local directory if it doesn't exist mkdir -p $LOCAL_DIR +# Export keyspace schema from the first node +echo "Exporting keyspace schema for $KEYSPACE from ${NODES[0]}" +ssh $SSH_USER@${NODES[0]} "$CQLSH $CQLSH_IP -e \"DESCRIBE KEYSPACE $KEYSPACE;\"" > data/${KEYSPACE}_schema.cql + + # Perform snapshot and copy for each node in parallel NODE_INDEX=1 for NODE in "${NODES[@]}"; do