diff --git a/examples/backup_and_process_tableConfig.sh b/examples/backup_and_process_tableConfig.sh new file mode 100755 index 0000000..fa0a5e4 --- /dev/null +++ b/examples/backup_and_process_tableConfig.sh @@ -0,0 +1,20 @@ +#!/bin/bash +mkdir -p backups +for i in `startree table listTables | jq -r '.tables | .[]'` +do +echo | startree table getConfig --tableName $i | jq '.' > $i.json + + +if [ `jq -r .realtime.tableType $i.json` = "REALTIME" ] +then echo | jq '.realtime' $i.json > $i.tableconfig.json +else echo | jq '.offline' $i.json > $i.tableconfig.json +fi + +echo | jq '.schema' $i.json > $i.schema.json + +mv $i.json backups +mv $i.*.json backups + +printf "$i backup created \n" +done +printf "All backups created \n"