There are three ways to backup SVN in Linux
1, Svnadmin Dump is the official recommended backup method, the advantage is more flexible, can be full-scale backup can also be incremental backup, and provide version recovery mechanism.
The disadvantage is that the version number is too large to increase to more than tens of thousands of, then the dump and load process will be very slow, long time is not conducive to rapid disaster recovery. This backup can be used in cases where the number of versions is small.
2, Svnadmin Hotcopy can only make a full-volume copy, can not be incremental backup. The advantage is faster backups and faster restores. The disadvantage is that hard drives are relatively expensive.
3, Svnsync is actually making 2 mirror libraries, when a bad time can quickly switch to another. More than 1.4 version support is required, not discussed here.
Svnadmin Dump Method:
1, the full amount of backup a warehouse:
#svnadmin Dump/svn/svn/app >/svn/svndump/app_dump160802
Configure the same SVN server to import the dump backup file on another machine
#svnadmin Load/svn/svn/app < app_dump160802
Copy the original server's configuration file back to the new server Authz, passwd, svnserver.conf
2. Incremental backup
#svnadmin dump/svn/svn/app-r 5200:5600--incremental >/svn/svndump/app_5600
5200 is the latest version at the time of the last full-volume backup, and 5600 is the current latest version.
Import: Svnadmin Load/svn/svn/app < app_5600
Svnadmin Hotcopy Method:
1. Backup
Svnadmin hotcopy/svn/svn/app//data/svn. ' Date +%f:%t '. Bak–clean-logs
If the –clean-logs option is passed, Svnadmin performs a hot copy operation and then removes the unused Berkeley DB log file.
You can run this command at any time to get a secure copy of the repository, regardless of whether other processes use the repository.
2. Restore
Svnadmin hotcopy/home/svn. ' Date +%f:%t '. Bak/home/svn. ' Date +%f:%t '. bak
Backup and recovery of SVN in Linux