Page 1 of 1

RDD tool dump, ambiguous redirect

Posted: Wed Aug 02, 2017 12:31 am
by s_dimzon
Hi,

I'm trying to run this

Code: Select all

cd /usr/local/nagios/share/perfdata/
for i in `find -name "*.rrd"`; do rrdtool dump $i > $i.xml; done
tar -cvzf perfdata.tar.gz */*.rrd.xml
for i in `find -name "*.rrd.xml"`; do rm -f $i; done
and this

Code: Select all

cd /usr/local/nagios/share/perfdata/
for i in `find -name "*.rrd"`; do rm -f $i; done
tar -xvzf perfdata.tar.gz
for i in `find -name "*.rrd.xml"`; do rrdtool restore $i `echo $i |sed s/.xml//g`; done
for i in `find -name "*.rrd"`; do chown nagios:nagios $i; done
for i in `find -name "*.rrd.xml"`; do rm -f $i; done
but Im having an ambiguous redirect, can you help me please. Im using Centos 5,6 and 7

Thank you!

Re: RDD tool dump, ambiguous redirect

Posted: Wed Aug 02, 2017 9:51 am
by tmcdonald

Re: RDD tool dump, ambiguous redirect

Posted: Thu Aug 03, 2017 2:25 am
by s_dimzon
Hi tmcdonald,

Thank you very much! Yep, this is a bash issue.
I've figured it out.
Here's what I've used and it worked (centos5 1386)
for i in $(find *.rrd); do rrdtool dump "$i" > "$i.xml"; done

Thanks!

Re: RDD tool dump, ambiguous redirect

Posted: Thu Aug 03, 2017 9:15 am
by tmcdonald
I'll be closing this thread now, but feel free to open another if you need anything in the future!