Svn real-time synchronization case!
Svnsync application scenarios:
1. Ease the pressure on a single svn version library
2. Allocate resource permissions more rationally
Svn real-time synchronization configuration: (for security reasons, svn ports and version libraries are replaced in Chinese)
Svn Master / Slave Building: environment: 192.168.1.221 Master 192.168.1.217 install svn version Library from 1 and Master / Slave respectively (skip) svn Master: [root@svn hooks] # cp pre-revprop-change.tmpl pre-revprop-change [root@svn hooks] # chmod + x pre-revprop-changevim pre-revprop-changeif ["$ACTION" = "M"-a "$PROPNAME" = "svn:log"]; then exit 0 Fiecho "Changing revision properties other than svn:log is prohibited" > & 2exit 0 [root@svn ~] # svnsync init svn://192.168.1.221/ version Library svn://192.168.1.217/ version Library-- source-username renzhiyuan-- source-password renzhiyuan-- sync-username renzhiyuan-- sync-password renzhiyuansvn from: [root@svnbak ~] # cd / usr/local/ version Library / hooks/ [root@svnbak hooks] # cp pre-revprop-change.tmpl pre- Revprop-change [root@svnbak hooks] # chmod + x pre-revprop-changevim pre-revprop-changeif ["$ACTION" = "M"-a "$PROPNAME" = "svn:log"] Then exit 0 Fiecho "Changing revision properties other than svn:log is prohibited" > & 2exit 0 initialize backup svn: (do not store things in the main library before initialization) [root@svn ~] # svnsync init svn://192.168.1.217/ version library svn://192.168.1.221/ version library-source-username renzhiyuan--source-password renzhiyuan--sync-username renzhiyuan--sync-password renzhiyuan- -attention! Your password, for authentication domain: can only be saved in plaintext on disk! If possible, consider configuring your system so that Subversion can save encrypted passwords. Refer to the documentation for more information. You can avoid this warning again by setting the option "store-plaintext-passwords" to "yes" or "no" in "/ root/.subversion/servers". -save unencrypted passwords (yes/no)? yessvnsync: the target version library has been synchronized with the "svn://192.168.1.221/ version library" [root@svn ~] # Test data begins to synchronize: [root@svn] # svnsync sync--non-interactive svn://192.168.1.217/ version Library-source-username renzhiyuan-- source-password renzhiyuan-- sync-username renzhiyuan-- sync-password renzhiyuan transfers file data. Version 1 has been submitted. Copy the properties of version 1. [root@svn ~] # automatic synchronization configuration: main library: [root@svn hooks] # pwd/usr/local/ version library / hooks [root@svn Hooks] # cp post-commit.tmpl post-commit [root@svn hooks] # chmod + x post-commit [root@svn hooks] # vim post-commit#REPOS= "$1" # REV= "$2" # mailer.py commit "$REPOS"$REV" / path/to/mailer.confecho off svnsync sync--non-interactive svn://192.168.1.217/ version Library-source-username renzhiyuan-- source-password renzhiyuan-- sync-username renzhiyuan-- sync-password renzhiyuan
Effect.