标签:压缩日志
#!/bin/bash
cd /tmp
LOG_PATH=`find /data/logs/ -mtime +1 -name "*".log | awk -F / ‘NF--‘|tr -s " " "/" | uniq`
for i in ${LOG_PATH};
do
cd ${i}
find . ! -name "." -type d -prune -o -type f -mtime +1 -name "*.log" -print |awk -F / ‘{print $2}‘ | xargs gzip -9
done
标签:压缩日志
原文地址:http://201438gz.blog.51cto.com/7940496/1596196