From 3977ec28e6688a9fe44155de0624544d272ca69a Mon Sep 17 00:00:00 2001 From: Keith Date: Tue, 21 Mar 2023 17:30:44 -0400 Subject: [PATCH] Create backup_and_process_tableConfig.sh this breaks up the file so it can be submitted into a new cluster --- examples/backup_and_process_tableConfig.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 examples/backup_and_process_tableConfig.sh 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"