########################################################### #This file has the details required for archival. #This is to be used for Log Roration script to be #excuted on each instance. #The columns are separated by a space. # #meshid absolutepathoflog/file thresholdsize iterationcount ########################################################### test0613 /opt/xxx/domains/test0613/dev/domain/test0613-dev/ipe/logs/*.log 5MB 3 test0513 /opt/xxx/domains/test0513/dev/domain/test0513-dev/* 3MB 2 test0413 /opt/xxx/domains/test0413/dev/domain/test0413-dev/bw/logs/* 2MB 2 test0813 /opt/xxx/domains/test0813/dev/platform/log/*.log 5KB 4 #### $file = "logconfig2.txt"; open(F,$file) or die "can't open the file $!\n"; while($line=) { chomp $line; if($line !~ /^#/) { ($id,$path,$size,$iter) = split(" ",$line); @ids = $id; @paths = $path; @sizes = $size; @iters = $iter; @files = `ls $path`; #print "$path\n"; foreach(@files) { $abspath = $path . $_; print "$abspath\n"; $flsize = `ls -lrt "$abspath" | awk -F" " '{print $5}'`; print "$flsize\n"; } } }