blob: 4852169942b2d979b70f56fb464d6fb23d8c5ff7 [file] [log] [blame]
Instrumentalbc299c02018-09-25 06:42:31 -05001#!/bin/bash
2#
3# Push data from Cassandra ".dat" files
4# These are obtained from "gzipped" files, or pre-placed (i.e. initialization)
5# in the "dats" directory
6#
7DIR=/opt/app/aaf/cass_init
8cd $DIR
9if [ ! -e dats ]; then
10 if [ -e dat.gz ]; then
11 tar -xvf dat.gz
12 else
13 echo "No Data to push for Cassandra"
14 exit
15 fi
16fi
17cd dats
18for T in $(ls *.dat); do
19 if [ -s $T ]; then
20 cqlsh -e "use authz; COPY ${T%.dat} FROM '$T' WITH DELIMITER='|';"
21 fi
22done
23cd $DIR
24#rm -Rf dats