archive_log.sh

 

#!/bin/bash
DATE=`date +’%Y-%m-%d’`

cd /home/log/sql
FILE=`ls –ignore=”sqltime_$DATE.log” –ignore=”sqlcount_$DATE.log” –ignore=”tar_log.sh” –ignore=”*.tar.gz”`
for i in $FILE
do
## 循环遍历静默压缩
tar -czf $i.tar.gz $i –remove-files
#zip -rq $i.zip $i
## 压缩完成显示一个
#echo $i.zip
done

发表评论