6 if [ -z "$INPUT" -o -z "$OUTPUT" ]
9 Usage: $0 <input> <output>
16 echo "No such file: $INPUT"
22 echo "File exists: $OUTPUT"
27 rrdtool dump "$INPUT" | while read LINE
31 if [ "$LINE" = "<ds>" ]
33 NUM_DS=$(($NUM_DS + 1))
36 if [ "$LINE" = "<!-- Round Robin Archives -->" ]
38 for CF in MIN MAX AVERAGE
43 <pdp_per_row> 1 </pdp_per_row>
44 <xff> 0.0000000000e+00 </xff>
48 for ((i=0; i < $NUM_DS; i++))
50 echo " <ds><value> NaN </value> <unknown_datapoints> 1 </unknown_datapoints></ds>"
55 DS_VALUES=`for ((i=0; i < $NUM_DS; i++)); do echo -n "<v> NaN </v>"; done`
56 for ((i=0; i < 2200; i++))
58 echo " <!-- $i --> <row>$DS_VALUES</row>"
66 rrdtool restore "$OUTPUT.xml" "$OUTPUT" -r >/dev/null