Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 1 | #!/bin/bash |
2 | # | ||||
3 | # Pull data from Cassandra into ".dat" files, and "gzip" them | ||||
4 | # | ||||
5 | DIR=/opt/app/aaf/cass_init | ||||
6 | cd $DIR | ||||
7 | mkdir -p dats | ||||
8 | cd dats | ||||
9 | TABLES="$(cqlsh -e "use authz; describe tables")" | ||||
10 | for T in $TABLES ; do | ||||
11 | cqlsh -e "use authz; COPY $T TO '$T.dat' WITH DELIMITER='|';" | ||||
12 | done | ||||
13 | cd $DIR | ||||
14 | tar -cvzf dat.gz dats/*.dat | ||||
15 | rm -Rf dats | ||||
16 |