#!/bin/ksh
year=`date +%Y`
month=`date +%m`
month=`expr $month - 1`
if [ $month -eq 0 ]
then
month=12
year=`expr $year - 1`
elif [ $month -lt 10 ]
then
month=`echo "0$month"`
fi
echo $year$month
#process query file backup
cd /query/backup
tar cvf ${year}${month}10.tar ./${year}${month}10
gzip ${year}${month}10.tar
rm -r -f ./${year}${month}10
tar cvf ${year}${month}20.tar ./${year}${month}20
gzip ${year}${month}20.tar
rm -r -f ./${year}${month}20
tar cvf ${year}${month}30.tar ./${year}${month}30
gzip ${year}${month}30.tar
rm -r -f ./${year}${month}30
全站熱搜
留言列表