RavenZZ
4/3/2018 - 5:34 AM

clean log files 查找并清空文件

n天内未修改 size超过n

# n天内未修改
find /home/deploy/micro-services -name "*.log" -mtime +3 |while read line; do cat /dev/null > "$line"; done;

# 大小超过800M
find /home/deploy/micro-services -name "*.log" -size +800M |while read line; do cat /dev/null > "$line"; done;