- 论坛徽章:
- 0
|
以下我写的脚本:但是只能手动输入各个时间来提取相应的值
*****************************************
ls /omp/omp-data/logs/HDR/sm_summary_files
echo welcome,please input the date yymmddhh
read dt
hw1="00GMT"
echo ********File name: AG_$dt$hw1.HDRFMS027********** >rstpxf
cd /omp/omp-data/logs/HDR/sm_summary_files
grep "AP " AG_$dt$hw1.HDRFMS027 >>/home/dllwy/rstpxf
grep AP_PEAK_PROC_OCCUPANCY AG_$dt$hw1.HDRFMS027 >>/home/dllwy/rstpxf
grep AP_AVG_PROC_OCCUPANCY AG_$dt$hw1.HDRFMS027 >>/home/dllwy/rstpxf
grep "TP " AG_$dt$hw1.HDRFMS027 >>/home/dllwy/rstpxf
grep TP_UTILIZATION AG_$dt$hw1.HDRFMS027 >>/home/dllwy/rstpxf
echo ********File name: AG_$dt$hw1.HDRFMS025********** >>/home/dllwy/rstpxf
grep "AP " AG_$dt$hw1.HDRFMS025 >>/home/dllwy/rstpxf
grep AP_PEAK_PROC_OCCUPANCY AG_$dt$hw1.HDRFMS025 >>/home/dllwy/rstpxf
grep AP_AVG_PROC_OCCUPANCY AG_$dt$hw1.HDRFMS025 >>/home/dllwy/rstpxf
grep "TP " AG_$dt$hw1.HDRFMS025 >>/home/dllwy/rstpxf
grep TP_UTILIZATION AG_$dt$hw1.HDRFMS025 >>/home/dllwy/rstpxf
cd /home/dllwy
more rstpx
****************************************************
要查询的文件存在以下目录:
/omp/omp-data/logs/HDR/sm_summary_files
该目录下有很多文件
以下是部分文件:
201109181600GMT.HCSFMS025 AG_201109181600GMT.HDRFMS025
201109181600GMT.HCSFMS027 AG_201109181600GMT.HDRFMS027
201109181700GMT.HCSFMS025 AG_201109181700GMT.HDRFMS025
201109181700GMT.HCSFMS027 AG_201109181700GMT.HDRFMS027
201109181800GMT.HCSFMS025 AG_201109181800GMT.HDRFMS025
201109181800GMT.HCSFMS027 AG_201109181800GMT.HDRFMS027
201109181900GMT.HCSFMS025 AG_201109181900GMT.HDRFMS025
201109181900GMT.HCSFMS027 AG_201109181900GMT.HDRFMS027
201109182000GMT.HCSFMS025 AG_201109182000GMT.HDRFMS025
201109182000GMT.HCSFMS027 AG_201109182000GMT.HDRFMS027
201109182100GMT.HCSFMS025 AG_201109182100GMT.HDRFMS025
201109182100GMT.HCSFMS027 AG_201109182100GMT.HDRFMS027
201109182200GMT.HCSFMS025 AG_201109182200GMT.HDRFMS025
201109182200GMT.HCSFMS027 AG_201109182200GMT.HDRFMS027
201109182300GMT.HCSFMS025 AG_201109182300GMT.HDRFMS025
201109182300GMT.HCSFMS027 AG_201109182300GMT.HDRFMS027
201109190000GMT.HCSFMS025 AG_201109190000GMT.HDRFMS025
201109190000GMT.HCSFMS027 AG_201109190000GMT.HDRFMS027
目前只需要对AG_开头的文件检索,文件夹下的文件周期性定时更新,会根据时间把前面的文件删除。 |
|