ERP,ARP瘦身并如何删除。

时间:2023-12-18 15:36:38

ERP,ARP瘦身

场景:由于ARP,ERP运行近10年,日志文件多而杂。清理ERP的日志文件有利于ERP的迁移。

1)ERP的相关日志文件如下:

/ora1159/prod/prodcomn/admin/log/PROD_arpinfo
/ora1159/prod/prodcomn/admin/out/PROD_arpinfo/*.out
/ora1159/prod/prodappl/admin/log/*.req
/ora1159/prod/prodappl/admin/prod/log/*.req
/ora1159/prod/prodcomn/temp
http log: /ora1159/prod/prodora/iAS/Apache/Apache/logs/

2)清除上述日志的两种方法

  • 第一种删除方法,直接删除目录重建
rm -rf /ora1159/prod/prodcomn/admin/log/PROD_arpinfo
mkdir -p /ora1159/prod/prodcomn/admin/log/PROD_arpinfo
chown -R applprod:dba /ora1159/prod/prodcomn/admin/log/PROD_arpinfo rm -rf /ora1159/prod/prodcomn/admin/out/PROD_arpinfo
mkdir -p /ora1159/prod/prodcomn/admin/out/PROD_arpinfo
chown -R applprod:dba /ora1159/prod/prodcomn/admin/out/PROD_arpinfo rm -rf /ora1159/prod/prodappl/admin/prod/log
mkdir -p /ora1159/prod/prodappl/admin/prod/log
chown -R applprod:dba /ora1159/prod/prodappl/admin/prod/log rm -rf /ora1159/prod/prodcomn/temp
mkdir -p /ora1159/prod/prodcomn/temp
chown -R applprod:dba /ora1159/prod/prodcomn/temp
  • 第二种删除方法,以xargs方式删除//由于碎文件太多
[root@arpinfo logs]# cd /ora1159/prod/prodora/iAS/Apache/Apache/logs
[root@arpinfo logs]# ls
[root@arpinfo logs]# touch 1.txt 2.txt 3.txt
[root@arpinfo logs]# find /ora1159/prod/prodora/iAS/Apache/Apache/logs/ -type f -name "*" -print0
----------------打印日志全部和在一起--------------------------------
/ora1159/prod/prodora/iAS/Apache/Apache/logs/1.txt/ora1159/prod/prodora/iAS/Apache/Apache/logs/2.txt/ora1159/prod/prodora/iAS/Apache/Apache/logs/3.txt [root@arpinfo logs]# find /ora1159/prod/prodora/iAS/Apache/Apache/logs/ -type f -name "*" -print0 | xargs -0
----------------xargs -0将\0作为定界符。日志的分割---------------------------------
/ora1159/prod/prodora/iAS/Apache/Apache/logs/1.txt /ora1159/prod/prodora/iAS/Apache/Apache/logs/2.txt /ora1159/prod/prodora/iAS/Apache/Apache/logs/3.txt //直接删除日志文件
find /ora1159/prod/prodora/iAS/Apache/Apache/logs/ -type f -name "*" -print0 | xargs -0 rm -f

3)ARP的相关文件并删除。

  • ARP的相关文件
/arp/jboss-4.2.D/server/default/log
/arp/primetongw/jboss-4.0.5/server/default/log
  • ARP的日志文件删除
find /arp/jboss-4.2.D/server/default/log/ -type f -name "*" -print0
find /arp/jboss-4.2.D/server/default/log/ -type f -name "*" -print0 | xargs -0 -n5 rm -f
find /arp/primetongw/jboss-4.0.5/server/default/log -type f -name "*" -print0 | xargs -0 -n5 rm -f

文献参考:http://blog.sina.com.cn/s/blog_769f68db0100ymw7.html