当前位置:网站首页>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
边栏推荐
- LeetCode 1658. Minimum operand to reduce x to 0
- 深入理解 SQL 中的 Grouping Sets 语句
- Talk about several methods of interface optimization
- 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
- Overview of satellite navigation system
- 数据分析必备的能力
- 大消费企业怎样做数字化转型?
- 比亚迪、长城混动市场再“聚首”
- Web crawler knowledge day03
- Leetcode: lucky number in matrix
猜你喜欢

MySQL converts comma separated attribute field data from column to row

What material is 13crmo4-5 equivalent to in China? 13crmo4-5 chemical composition 13crmo4-5 mechanical properties

Idea configuration plug-in

Daily code 300 lines learning notes day 10

What is the material of sa302grc? American standard container plate sa302grc chemical composition

Shentong express expects an annual loss of nearly 1billion
智慧之道(知行合一)

Take you to API development by hand

新库上线 | CnOpenData中国保险机构网点全集数据

The most complete postman interface test tutorial in the whole network, API interface test
随机推荐
What kind of material is 14Cr1MoR? Analysis of chemical composition and mechanical properties of 14Cr1MoR
远程办公之如何推进跨部门项目协作 | 社区征文
[try to hack] active detection and concealment technology
C语言字符串反转
Résolution de l'instance d'assemblage - - affichage à l'écran en mode réel
The largest matrix (H) in a brush 143 monotone stack 84 histogram
[combinatorics] non descending path problem (number of non descending paths with constraints)
How to promote cross department project collaboration | community essay solicitation
Summary of three methods of PHP looping through arrays list (), each (), and while
Squid service startup script
One brush 144 force deduction hot question-1 sum of two numbers (E)
Free data | new library online | cnopendata complete data of China's insurance intermediary outlets
数据分析必备的能力
图之深度优先搜索
大消费企业怎样做数字化转型?
人生还在迷茫?也许这些订阅号里有你需要的答案!
Idea configuration plug-in
CC2530 common registers for watchdog
[combinatorics] recursive equation (definition of general solution | structure theorem of general solution of recursive equation without multiple roots)
What material is sa537cl2 equivalent to in China? Sa537cl2 corresponding material