파일백업_스크립트

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

파일백업_스크립트 [2017/02/08 17:20] (현재)
koov 만듦
줄 1: 줄 1:
 +====== 파일 백업 스크립트 ======
 +
 +
 +예제
 +
 +<WRAP prewrap>
 +<code vim file_backup.sh>
 +####################################################################
 +# rhevm Backup script                                              #
 +# create : KangWoo Lee                                             #
 +# date   : 2013.03.12                                              #
 +#                                                                  #
 +# Variables                                                        #
 +# DEST_DIR : backup archive creating directory                     #
 +# TARGETS  : backup target files                                   #
 +#                                                                  #
 +####################################################################
 +#!/bin/sh
 +DEST_DIR=.
 +DATE=`date +%F`
 +LINE="=========================================="
 +
 +
 +echo $LINE
 +echo "[$DATE] Backup Script Start"
 +echo $LINE
 +
 +# Backup Target define
 +
 +TARGETS=(
 +/etc/jbossas/jbossas.conf
 +/etc/rhevm/
 +/etc/yum/pluginconf.d/versionlock.list
 +/etc/pki/rhevm/
 +/etc/jbossas/rhevm-slimmed/
 +/var/lib/jbossas/server/rhevm-slimmed
 +/usr/share/rhevm-reports-server/buildomatic
 +/usr/share/rhevm/conf/iptables.example
 +/usr/share/rhevm/kerberos/krb5.conf
 +/usr/share/rhevm/dbscripts/create_db.sh.log
 +/usr/share/rhevm/rhevm.ear/rhevmanager.war/ExternalConfig.txt
 +/usr/share/rhevm/rhevm.ear/rhevmanager.war/ServerParameters.js
 +#/usr/share/rhevm-reports/reports-INSERT_VERSION_NUMBER/resources/organizations/rhevmreports/Resources/JDBC/data_sources/rhevm.xml
 +#/usr/share/rhevm-reports/reports-INSERT_VERSION_NUMBER/users/rhevmreports/rhevm-002dadmin.xml
 +/usr/share/rhevm-reports/
 +#/usr/share/rhevm-reports-server/buildomatic/default_master.properties
 +#/usr/share/rhevm-reports-server/buildomatic/install.xml
 +#/usr/share/rhevm-reports-server/buildomatic/setup.xml
 +/usr/share/rhevm-reports-server/buildomatic/
 +/root/.pgpass
 +/root/.rnd
 +)
 +
 +# Destination directory check
 +if [ ! -e $DEST_DIR ]
 +then
 + echo "Destination directory is NOT EXISTS! creating..."
 + mkdir -p $DEST_DIR
 +fi
 +
 +# File Check
 +for T in ${TARGETS[*]}
 +do
 + #echo $T
 + if [ -e $T ]
 + then
 + echo "$T is exists"
 + else
 + echo "$T is not exists"
 + fi
 +done
 +
 +# Backup Archive Create
 +tar -cvzf $DEST_DIR/rhevm_backup-$DATE.tgz ${TARGETS[*]}
 +
 +echo $LINE
 +echo "Backup End"
 +echo $LINE
 +</code>
 +</WRAP>
  
  • 파일백업_스크립트.txt
  • 마지막으로 수정됨: 2017/02/08 17:20
  • 저자 koov