Created
April 7, 2015 09:12
-
-
Save nekoruri/4fab0883861de6ee9bf4 to your computer and use it in GitHub Desktop.
GrowthForecastで特定期間の値をNaNに落とす
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
#!/bin/bash | |
ids="32 33 34 35 36 42 43 44 45 46 47 48 49 50 51" | |
for id in $ids; do | |
echo $id | |
file_base=$(echo -n "$id" | openssl md5 -hex | awk '{print $2}') | |
files=$(ls -1 ${file_base}{,_s}.rrd) | |
for file in $files; do | |
echo " $file" | |
rrdtool dump $file \ | |
| sed -e '/ 2015-04-07 \(14:[1-5].\|1[56]:..\|17:00\):00 JST/s/<row>.*$/<row><v>NaA<\/v><v>NaA<\/v><\/row>/' \ | |
> $file.xml | |
rrdtool restore -f $file.xml $file | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ファイル名は、DBのgraphsテーブルのIDをMD5してHEXしたもの。
_s無しがデフォルトで、1分グラフの値が_s付きの方。