summaryrefslogtreecommitdiffstats
path: root/auth/auth-cass/cass_init/pull.sh
blob: b25099f814a55a1408ebc098a5c553f3950a5da6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
#
# Pull data from Cassandra into ".dat" files, and "gzip" them
#
DIR=/opt/app/aaf/cass_init
cd $DIR
mkdir -p dats
cd dats
TABLES="$(cqlsh -e "use authz; describe tables")"
for T in $TABLES ; do
  cqlsh -e "COPY authz.$T TO '$T.dat' WITH DELIMITER='|';"
done
cd $DIR
tar -cvzf dat.gz dats/*.dat
rm -Rf dats