How do I back up a remote SVN repository

后端 未结 9 1301
被撕碎了的回忆
被撕碎了的回忆 2020-12-22 20:04

I am currently moving my SVN server from my home server to my remote server so I can access it more easily from other locations. My remote server is not backed up so I want

9条回答
  •  温柔的废话
    2020-12-22 20:30

    To expand on Stefans answer, here are some windows batch scripts to help automate the process a little.

    svn-backup-init.bat

    @echo off
    set /P directory="Local Directory: "
    set /P URL="Svn URL: "
    
    echo "Running SVN backup";
    
    @echo on
    svnadmin create %directory%
    echo exit 0 > %directory%\hooks\pre-revprop-change.bat
    svnsync init file:///%directory% %URL%
    svnsync sync file:///%directory%**strong text**
    

    This script will create the svn repo, and check it out and do a sync immediately. When you run the script just enter the directory to put the repo locally and the URL of the server to use.

    svn-backup-run.bat

    for /d %%i in (%~dp0*) do ( svnsync sync file:///%%i ) 
    

    This will loop through each directory and run the svnsync command. If you have multiple repos, check them out into the same folder. This can then easily be added as a Task in windows to update all your repos at once.

    Folder Structure

    I use a folder structure as such:

    .
    ├── svn-backups
    |   ├── repo-1
    |   ├── repo-2
    |   ├── repo-3
    |   ├── svn-backup-init.bat
    |   └── svn-backup-run.bat
    

提交回复
热议问题