Skip to content

Instantly share code, notes, and snippets.

@jasonjohnson
Created January 22, 2014 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonjohnson/8566490 to your computer and use it in GitHub Desktop.
Save jasonjohnson/8566490 to your computer and use it in GitHub Desktop.
TSDB="/root/opentsdb/build/tsdb"
ZK="zk0,zk1,zk2"
IN="truncate.txt"
FN="sum"
START=`date -d '2 years ago' '+%Y/%m/%d-%H:%M'`
STOP=`date -d '4 hours ago' '+%Y/%m/%d-%H:%M'`
echo $START
echo $STOP
cat $IN | while read metric; do
if [ -z $metric ]; then
continue
fi
echo "Truncate: $metric"
$TSDB scan --delete --zkquorum=$ZK $START $STOP $FN $metric > /dev/null
done
metric0
metric1
metric2
metric3
metric4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment