I need to restore rrd files from my exisiting xml files. So I have used following simple bash script.
#!/bin/bash
for i in /home/dump_xml/*.xml;
do
rrdtool restore $i /home/rrd_new/"${i%.xml}".rrd;
done
I could not execute following script due to this error,
ERROR: Could not create xml reader for: /home/dump_xml/*.xml
But I could restore files one by one. Can someone help me to solve this?
When you use:
You will see that $i equals:
You see, it contains the path. Therefore your
rddtoolwill try to write the results in/home/dump_xml/home/dump_xml/a.rrd.You have to do:
Do not forget to double-quote your variable extensions.