当前位置:网站首页>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
边栏推荐
- SVN完全备份svnadmin hotcopy
- Hands on in-depth learning notes (XIV) 3.7 Simple implementation of softmax regression
- PHP online confusion encryption tutorial sharing + basically no solution
- Recommendation of good books on learning QT programming
- [combinatorial mathematics] recursive equation (example of recursive equation 2 Hanoi Tower | example of recursive equation 3 insertion sequencing)
- What is the difference between 14Cr1MoR container plate and 14Cr1MoR (H)? Chemical composition and performance analysis of 14Cr1MoR
- Meituan side: why does thread crash not cause JVM crash
- MySQL user management
- Mysql database -dql
- LeetCode 1656. Design ordered flow
猜你喜欢
utfwry. Dat PHP, about ThinkPHP's method of IP location using utfwry address Library
Talk about several methods of interface optimization
ucore概述
CC2530 common registers for timer 1
建立自己的网站(23)
Mysql database DDL and DML
MySQL Basics
One brush 145 force deduction hot question-2 sum of two numbers (m)
Prepare for the golden three silver four, 100+ software test interview questions (function / interface / Automation) interview questions. win victory the moment one raises one 's standard
What material is sa537cl1? Sa537cl1 corresponds to the national standard material
随机推荐
C语言字符串练习
[combinatorics] polynomial theorem (polynomial theorem | polynomial theorem proof | polynomial theorem inference 1 item number is the number of non negative integer solutions | polynomial theorem infe
[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
线程池:业务代码最常用也最容易犯错的组件
Depth first search of graph
vs code 插件 koroFileHeader
The most complete postman interface test tutorial in the whole network, API interface test
How to judge the region of an IP through C?
The word backspace key cannot delete the selected text, so you can only press Delete
Résolution de l'instance d'assemblage - - affichage à l'écran en mode réel
The way of wisdom (unity of knowledge and action)
How to delete a specific line from a text file using the SED command?
word 退格键删除不了选中文本,只能按delete
function overloading
Redis:关于列表List类型数据的操作命令
SVN完全备份svnadmin hotcopy
Overview of satellite navigation system
Interpretation of several important concepts of satellite antenna
【剑指 Offer】58 - I. 翻转单词顺序
RF Analyze Demo搭建 Step by Step