summaryrefslogtreecommitdiffstats
path: root/auth/auth-cass/cass_init/pull.sh
blob: 94695ed19a008c74f95595a45fc188281f6f0a63 (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 "use authz; COPY $T TO '$T.dat' WITH DELIMITER='|';"
done
cd $DIR
tar -cvzf dat.gz dats/*.dat
rm -Rf dats