标签:type rm -rf tab ls -l data find rgs nohup cat
查找大文件并清空#!/bin/bash
#定期清理日志文件超过1G--nohup.out
#by licb @20190222
for i in `find ./ -type f -size +1000M -name nohup.out`
do
cat /dev/null > $i
ls -lh $i
done
[root@netshop-vm2 scripts]# crontab -l
* * * * 7 root /bin/bash /data/application/scripts/autoclean_nohup.out.sh
find ./ -type f -size +1000M -name nohup.out -exec rm -rf {}\;
find ./ -type f -size +1000M -name nohup.out | xargs ls -l
标签:type rm -rf tab ls -l data find rgs nohup cat
原文地址:https://blog.51cto.com/lcpljc/2357333