forked from yamcs/snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit dc21dc3
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#/bin/bash | ||
|
||
# This script can be used to export and import the tm,pp and events tables in order to bring them to the latest definition | ||
# | ||
# It can also be run to repartition the data because once a table has been created with a partitioning schema it cannot be changed unless dropping it and recreating it. | ||
# | ||
# IMPORTANT: make sure you take a backup of the yamcs-data directory before running this. | ||
set -e | ||
|
||
|
||
INSTANCE="myproject" | ||
echo "Stopping the instance $INSTANCE" | ||
yamcs instances stop $INSTANCE | ||
|
||
echo "Exporting tm, events and pp tables" | ||
yamcs tables dump --gzip tm | ||
yamcs tables dump --gzip events | ||
yamcs tables dump --gzip pp | ||
|
||
|
||
echo "Dropping the tm, events and pp tables" | ||
yamcs dbshell -c "drop table tm" | ||
yamcs dbshell -c "drop table events" | ||
yamcs dbshell -c "drop table pp" | ||
|
||
echo "starting the instance in order to recreate the tables" | ||
yamcs instances start $INSTANCE | ||
|
||
echo "importing back the data" | ||
yamcs tables load --gzip tm | ||
yamcs tables load --gzip events | ||
yamcs tables load --gzip pp | ||
|
||
echo "rebuilding the histograms for the tm and pp tables" | ||
yamcs tables rebuild-histogram tm | ||
yamcs tables rebuild-histogram pp | ||
|
||
echo "rebuilding the ccsds completeness index" | ||
yamcs packets rebuild-ccsds-index | ||
|