BIDeveloper
BIDeveloper

Reputation: 2638

Subversion: Automate Backups or Copy from Server

We have a collabnet instance of subversion running on our site. We also have a third party company who do work for us. They use subversion hosted on beanstalk.

It would be great if we could somehow, each night, move a copy of the trunk folder on beanstalk into our own subversion.

Does anyone know if this is possible, or at least if it would be possible to automate and just dump into a windows folder?

Thanks in advance,

Jim

Upvotes: 0

Views: 104

Answers (1)

dnewcome
dnewcome

Reputation: 2075

You could use

svnadmin dump trunk > trunk.dmp

then

svnadmin load --parent-dir remote trunk < trunk.dmp

This will export the trunk from the server in a file and import it again on your repository under the parent directory 'remote'. You'll probably want to script this so that you have the date in the parent folder or something like that. This might cause your repo to grow though since you are importing similar code over and over. One thing that you could do would be to do the load once and then check the code out into a working folder and then use

svn switch --relocate <from url> <to url> .

The idea is to switch to the remote, check out, switch to the local, check in. I haven't tested anything like this so it might not work quite this way. At the very least you should be able to keep two working folders, one for local, one for remote, and do a simple file copy into the destination and check in. This can all be automated via scripting the svn.exe command.

Alternatively if just having the code available in a working folder you could just keep their code synced by checking out from their repo every day. This could be automated just using:

svn co <path to server> <path to working folder>

If this command is set to run as a scheduled task you would always have their latest code at the end of the day in the working folder.

Upvotes: 1

Related Questions