当前位置:网站首页>Svn full backup svnadmin hotcopy
Svn full backup svnadmin hotcopy
2022-07-03 17:04:00 【Brother Xing plays with the clouds】
utilize svnadmin hotcopy Full backup is possible , But incremental backup is not possible .svnadmin hotcopy Is to put the whole library “ heat ” Make a copy of it , Including the hook script of the Library 、 Configuration files, etc ; Any time you run this script, you get a secure copy of the version Library , Whether or not other processes are using the version Library .
Advantage is : Fast backup process , Disaster recovery is also fast ; If the backup machine has been set up svn service , You don't even need to recover , Simply configure to switch to the backup database .
The disadvantage is that : It costs a lot of hard disk , Need to have larger hard disk support .
Backup command :
svnadmin hotcopy /path/to/repository /path/to/backup
1) Define backup policies Backup frequency : Make a full backup every day . Backup location : The backup directory is named after the current time , Backup path to /data/svnbackup/. Backup retention period : Retain 7 God , exceed 7 Days to delete . Backup time : Every night 11 spot 59 Point start . Backup check : Automatically check whether the backup is correct after the backup 、 Log . 2) Create a backup script
stay /data/shells Directory creation backup script svnbak.sh, If svn The warehouse path is /data/svn, To back up to /data/svnbackup/:
#!/bin/bash
#
# Filename: svnbak.sh
# Revision: 1.0
# Date: 2014/11/07
# Author: Qicheng
# Email:
# Website:
# Description: SVN Full backup
# Notes: Add script to crontab in , Regular execution every day
#
MAXDAYS=7 # The maximum number of days to keep the backup
TIME=`date +'%Y%m%d%H%M%S'`
SVNPATH=/data/svn # Define the warehouse repos route
BAKDIR=/data/svnbackup # Define the backup home directory
BAKSUBDIR=${BAKDIR}/${TIME} # Define the full path
BAKLOG=${BAKDIR}/${TIME}.log # Define backup logs
[ ! -f "${BAKSUBDIR}" ] && mkdir -p ${BAKSUBDIR}
exec 1>${BAKLOG}
exec 2>&1
set -x
# Delete historical backup
find ${BAKDIR} -maxdepth 1 -type f -mtime +$(expr ${MAXDAYS} - 1) -exec echo "Delete {}" \; -exec rm "{}" \;
# Full backup
svnadmin hotcopy ${SVNPATH} ${BAKSUBDIR}
# If you can print the version number, it means that the backup is correct
svnlook youngest ${BAKSUBDIR}
[ $? -ne 0 ] && exit 1
cd ${BAKDIR}
# Compressed backup
tar cvzf ${TIME}.tar.gz ${TIME}/
rm -rf ${BAKSUBDIR}
# Can pass rsync Synchronize the backup files to the remote backup machine , Omit here .
Test it :
3) Set the timing crontab
Every day 23 spot 59 Start executing the script in minutes :
59 23 * * * /bin/bash /data/shells/svnbak.sh
边栏推荐
- What is the material of sa302grc? American standard container plate sa302grc chemical composition
- 网络硬盘NFS的安装与配置
- CC2530 common registers for timer 1
- 27. Input 3 integers and output them in descending order. Pointer method is required.
- 線程池:業務代碼最常用也最容易犯錯的組件
- C语言按行修改文件
- BYD and great wall hybrid market "get together" again
- Rsync远程同步
- 简单配置PostFix服务器
- CC2530 common registers for port initialization
猜你喜欢

Build your own website (23)

NLP four paradigms: paradigm 1: fully supervised learning in the era of non neural networks (Feature Engineering); Paradigm 2: fully supervised learning based on neural network (Architecture Engineeri

2022.02.14_ Daily question leetcode five hundred and forty

Kotlin学习快速入门(7)——扩展的妙用

PHP online confusion encryption tutorial sharing + basically no solution

Mysql database -dql

Web crawler knowledge day03

Depth first search of graph

ANOVA example

One brush 145 force deduction hot question-2 sum of two numbers (m)
随机推荐
新库上线 | CnOpenData中国观鸟记录数据
远程办公之如何推进跨部门项目协作 | 社区征文
Execute script unrecognized \r
Meituan side: why does thread crash not cause JVM crash
CC2530 common registers
Apache服务挂起Asynchronous AcceptEx failed.
Life is still confused? Maybe these subscription numbers have the answers you need!
function overloading
數據分析必備的能力
[combinatorics] recursive equation (characteristic equation and characteristic root | example of characteristic equation | root formula of monadic quadratic equation)
大变局!全国房价,跌破万元大关
NLP four paradigms: paradigm 1: fully supervised learning in the era of non neural networks (Feature Engineering); Paradigm 2: fully supervised learning based on neural network (Architecture Engineeri
IDEA-配置插件
Shentong express expects an annual loss of nearly 1billion
PHP converts a one-dimensional array into a two-dimensional array
mysql用户管理
13mnnimo5-4 German standard steel plate 13MnNiMo54 boiler steel 13MnNiMo54 chemical properties
网络硬盘NFS的安装与配置
One brush 148 force deduction hot question-5 longest palindrome substring (m)
匯編實例解析--實模式下屏幕顯示