Linux下备份cvs数据库shell脚本

#!/bin/sh DISK_SIZE=`df -k|grep /dev/sda7 |awk '{ print substr($5,1,2) }'` todate=`date +%Y%m%d_%w` thrday=`date -d '3 days ago' +%Y%m%d_%w` if [ $DISK_SIZE -gt 85 ]; then echo DISK_SIZE is $DISK_SIZE over 85 exit else echo DISK_SIZE=$DISK_SIZE fi tar -cvf /orabak/cvs_bak/cvs_work_$todate.tar /cvs_work tar -cvf /orabak/cvs_bak/cvs_back_$todate.tar /cvs_back gzip /orabak/cvs_bak/cvs_work_$todate.tar gzip /orabak/cvs_bak/cvs_back_$todate.tar rm -rf /orabak/cvs_bak/cvs_work_$thrday.tar.gz rm -rf /orabak/cvs_bak/cvs_back_$thrday.tar.gz

你可能感兴趣的:(Linux下备份cvs数据库shell脚本)