mirror of
https://github.com/manuelkasper/AS-Stats.git
synced 2025-02-20 11:44:12 +08:00
Merge pull request #95 from schadom/master
Optimized the script to work with empty rrd directories
This commit is contained in:
commit
93fb606c46
@ -5,18 +5,16 @@
|
|||||||
## my $newlinkname = 'NEWIDFROMKNOWNLINKSFILE';
|
## my $newlinkname = 'NEWIDFROMKNOWNLINKSFILE';
|
||||||
## to reflect the ID in the known links file
|
## to reflect the ID in the known links file
|
||||||
|
|
||||||
A=`ls -1`
|
A=`find . -type f -name '*.rrd' | sed -r 's|/[^/]+$||' |sort |uniq`
|
||||||
|
W=`pwd`
|
||||||
|
|
||||||
for i in $A ; do
|
for i in $A ; do
|
||||||
echo ""
|
|
||||||
echo "dir: $i"
|
|
||||||
echo ""
|
|
||||||
cd $i
|
cd $i
|
||||||
|
|
||||||
for f in *.rrd; do
|
for f in *.rrd; do
|
||||||
echo "file: $f"
|
echo "file: $i/$f"
|
||||||
mv $f $f.old
|
mv $f $f.old
|
||||||
rrdtool dump $f.old | /data/as-stats/tools/add_ds_proc.pl | rrdtool restore - $f.new
|
rrdtool dump $f.old | $W/add_ds_proc.pl | rrdtool restore - $f.new
|
||||||
mv $f.new $f
|
mv $f.new $f
|
||||||
rm -f $f.old
|
rm -f $f.old
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user