シナリオsmgpGate_ログバックアップ
7329 ワード
- vi smgpGate_Log_tar.sh
- #!/bin/sh
- dirname="$(date +%Y%m%d)"
- a1=/usr/local/smgpGate/smgpGate_Log/DAO
- a2=DAO.txt.*
- a3=/usr/local/smgpGate/smgpGate_Log/deliver
- a4=deliver.txt.*
- a5=/usr/local/smgpGate/smgpGate_Log/receiver
- a6=receiver.txt.*
- a7=/usr/local/smgpGate/smgpGate_Log/report
- a8=report.txt.*
- a9=/usr/local/smgpGate/smgpGate_Log/server
- a10=server.txt.*
-
- c1=/usr/local/copydata/smgpGate_Log/
- c2=/usr/local/copydata/smgpGate_Log/smgpGate_Log_$dirname
- c3=/var/log/filecopy/smgpGate_Log/
- c4=/var/log/filecopy/smgpGate_Log/smgpGate_Log_$dirname
- d1=smgpGate_Log_$dirname
-
- #
- mkdir -p $c2
- mkdir -p $c3
-
- #
- cd $a1
- mv $a2 $c2
- cd $a3
- mv $a4 $c2
- cd $a5
- mv $a6 $c2
- cd $a7
- mv $a8 $c2
- cd $a9
- mv $a10 $c2
-
- #
- cd $c1
- tar -zcvf $d1.tar.gz $d1 >> $c4
-
- #
- echo "rm start" >> $c4
- rm -rvf $d1 >> $c4
=================================================
- vi smgpGate_Log_tar.sh
- #!/bin/sh
- dirname="$(date +%Y%m%d)"
- a=/usr/local/copydata/smgpGate_Log/
- b="smgpGate_Log_"$dirname
- c=$a$b
- d="/var/log/filecopy/smgpGate_Log/smgpGate_Log_tar_"$dirname".log"
- e="/var/log/filecopy/smgpGate_Log/"
- f=$b.tar.gz
-
- mkdir -p $a
- mkdir -p $e
- #
- cd /usr/local/smgpGate
- mv smgpGate_Log $c
- #
- /backup/bin/smgpGate_Log_mk.sh
- #
- cd $a
- tar -zcvf $b.tar.gz $b >> $d
- #
- rm -rvf $b >> $d
- vi /backup/bin/smgpGate_Log_mk.sh
- #!/bin/sh
- a=/usr/local/smgpGate/smgpGate_Log
- mkdir -p $a
- cd $a
- mkdir DAO
- mkdir deliver
- mkdir receiver
- mkdir report
- mkdir server