标签:com oss info 迁移 dmi -name blog 文件删除 删除日志
场景:由于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
[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/jboss-4.2.D/server/default/log
/arp/primetongw/jboss-4.0.5/server/default/log
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
标签:com oss info 迁移 dmi -name blog 文件删除 删除日志
原文地址:https://www.cnblogs.com/zhangshengdong/p/9516630.html