#!/usr/bin/perl # # # quick script by Sheer # half of a pair of scripts that dump and restore rrdtools files for SystemStats2 # to help simplify migration from 32 to 64 bit arch $xpath = "/var/SystemStats2"; $outpath = "/tmp/SystemStats2"; opendir(DH, $xpath); while($file = readdir(DH)) { next if (! -d "$xpath/$file"); opendir (DY, $xpath . "/" . $file); while($dfile = readdir(DY)) { $fullpath = $xpath . "/" . $file . "/" . $dfile; mkdir("$outpath/$file"); $cmd = "rrdtool dump $fullpath $outpath/$file/$dfile.xml"; $result = system($cmd); print "$cmd: $result\n"; } closedir(DY); }