[root@BMS020 bak]# cat tarbakreq.sh
#!/bin/bash
set -x
. /etc/profile
#LOGFILE="/tmp/tarreq.log"
DIR="/opt/onlineorder/bak/"
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
[root@BMS020 bak]# cat tarbakreq.sh
#!/bin/bash
set -x
. /etc/profile
#LOGFILE="/tmp/tarreq.log"
DIR="/opt/onlineorder/bak/"
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