当前位置:网站首页>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
边栏推荐
- [sword finger offer] 58 - I. flip the word order
- Apache服务挂起Asynchronous AcceptEx failed.
- 数据分析必备的能力
- How to delete a specific line from a text file using the SED command?
- [combinatorics] recursive equation (constant coefficient linear homogeneous recursive equation | constant coefficient, linear, homogeneous concept description | constant coefficient linear homogeneous
- 深入理解 SQL 中的 Grouping Sets 语句
- [combinatorics] recursive equation (the relationship theorem between the solution of the recursive equation and the characteristic root | the linear property theorem of the solution of the recursive e
- C语言按行修改文件
- NLP四范式:范式一:非神经网络时代的完全监督学习(特征工程);范式二:基于神经网络的完全监督学习(架构工程);范式三:预训练,精调范式(目标工程);范式四:预训练,提示,预测范式(Prompt工程)
- Mysql database DDL and DML
猜你喜欢
CC2530 common registers for port interrupts
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
人生还在迷茫?也许这些订阅号里有你需要的答案!
Thread pool executes scheduled tasks
The most complete postman interface test tutorial in the whole network, API interface test
CC2530 common registers for serial communication
What material is 12cr1movr? Chemical property analysis of pressure vessel steel plate 12cr1movr
MySQL converts comma separated attribute field data from column to row
Simulink oscilloscope data is imported into Matlab and drawn
Daily code 300 lines learning notes day 10
随机推荐
[combinatorics] recursive equation (characteristic equation and characteristic root | example of characteristic equation | root formula of monadic quadratic equation)
Free data | new library online | cnopendata complete data of China's insurance intermediary outlets
Build your own website (23)
UCORE overview
在iptables防火墙下开启vsftpd的端口
Rsync远程同步
MySQL Basics
New features of C 10
新库上线 | CnOpenData中国保险机构网点全集数据
The word backspace key cannot delete the selected text, so you can only press Delete
Arduino esp32: overall framework of lvgl project (I)
Kotlin学习快速入门(7)——扩展的妙用
Apache服务挂起Asynchronous AcceptEx failed.
Fast Ethernet and Gigabit Ethernet: what's the difference?
Deep understanding of grouping sets statements in SQL
C language modifies files by line
[combinatorics] polynomial theorem (polynomial coefficients | full arrangement of multiple sets | number of schemes corresponding to the ball sub model | polynomial coefficient correlation identity)
[combinatorics] recursive equation (outline of recursive equation content | definition of recursive equation | example description of recursive equation | Fibonacci Series)
[combinatorial mathematics] counting model, common combinatorial numbers and combinatorial identities**
[Jianzhi offer] 64 Find 1+2+... +n