gzip压缩大日志文件 #!/bin/bash day=$(date +'%Y-%m-%d') cd /data/publish/logs log=$(ls -lh | grep G | grep -v $day | awk 'NR==2{print $9}') if [[ -n $log ]];then gzip $log else exit fi