按星期备份脚本

Lcbakdir=/oracle/flash_recovery_area/VODDB/backupset
Rembakdir=/home/bakuser/bakdata/db_82_203
HOSTNAME="172.30.82.15"
Datedir=`date +%w`
bakdata=`date +%Y_%m_%d`
echo $bakdata
#bakdata=`date -d yesterday +%Y_%m_%d`
cd $Lcbakdir/$bakdata

#mkdir week_$Datedir
#cd week_$Datedir
#Filenamefix=`date -d yesterday +%y%m%d`.tar.gz

for i in $HOSTNAME
do
scp $Lcbakdir/$bakdata/* bakuser@$i:$Rembakdir/week$Datedir/
#ssh $i rm -rf $Rembakdir/*week$Datedir*
done

本文出自 “皓月无痕泽哥地带” 博客,谢绝转载!

你可能感兴趣的:(oracle,职场,休闲,cd,yesterday)