压缩目录,生成gz包,并删除原目录
[root@BMS020 source]# cat tarsourcereq.sh
#!/bin/bash
set -x
. /etc/profile
#LOGFILE="/tmp/tarreq.log"
DIR="/opt/onlineorder/source/"
cd $DIR
for i in `find . -type d -mtime +3 | grep -v gz`
do
tar cvzf $i.tar.gz $i
rm -rf $i
done
exit