当前位置:网站首页>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
边栏推荐
- C language string practice
- CC2530 common registers for port initialization
- 跨境电商:外贸企业做海外社媒营销的优势
- utfwry. Dat PHP, about ThinkPHP's method of IP location using utfwry address Library
- Idea configuration plug-in
- One brush 149 force deduction hot question-10 regular expression matching (H)
- 美团一面:为什么线程崩溃崩溃不会导致 JVM 崩溃
- Fast Ethernet and Gigabit Ethernet: what's the difference?
- SVN完全备份svnadmin hotcopy
- Informatics Olympiad all in one YBT 1175: divide by 13 | openjudge noi 1.13 27: divide by 13
猜你喜欢

Arduino esp32: overall framework of lvgl project (I)

Leetcode: lucky number in matrix

CC2530 common registers for ADC single channel conversion

UCORE overview

Shentong express expects an annual loss of nearly 1billion

网络安全web渗透技术

手把手带你入门 API 开发

What material is sa537cl2 equivalent to in China? Sa537cl2 corresponding material

Analysis of variance summary

CC2530 common registers for crystal oscillator settings
随机推荐
C语言字符串反转
One brush 142 monotone stack next larger element II (m)
匯編實例解析--實模式下屏幕顯示
How to allow remote connection to MySQL server on Linux system?
What material is 12cr1movr? Chemical property analysis of pressure vessel steel plate 12cr1movr
[combinatorial mathematics] recursive equation (example of recursive equation 2 Hanoi Tower | example of recursive equation 3 insertion sequencing)
29:第三章:开发通行证服务:12:开发【获得用户账户信息,接口】;(使用VO类包装查到的数据,以符合接口对返回数据的要求)(在多处都会用到的逻辑,在Controller中可以把其抽成一个共用方法)
New features of C 10
Capacités nécessaires à l'analyse des données
Kotlin学习快速入门(7)——扩展的妙用
UCORE overview
[try to hack] active detection and concealment technology
Network security web penetration technology
Build your own website (23)
[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
Necessary ability of data analysis
聊聊接口优化的几个方法
C language string practice
Simulink oscilloscope data is imported into Matlab and drawn
智慧之道(知行合一)