码迷,mamicode.com
首页 > 其他好文 > 详细

ERP,ARP瘦身并如何删除。

时间:2018-08-22 12:01:59      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:com   oss   info   迁移   dmi   -name   blog   文件删除   删除日志   

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

ERP,ARP瘦身并如何删除。

标签:com   oss   info   迁移   dmi   -name   blog   文件删除   删除日志   

原文地址:https://www.cnblogs.com/zhangshengdong/p/9516630.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!