Please find attached a pull request that adds support for backing up SCMs (both with Git and SVN) into Backup.
I have tried to mimic the changes you made to my previous pull request (RSync::Push-Pull-etc). For example, this version uses a "repositories" property (alias for "directories") like so:
Backup::Model.new(:hdl_make, 'Description for hdl_make') do
sync_with SCM::Git do |git|
git.ip = "example.com"
git.path = "backups/git"
This will backup the repositories git://example.com/misc/repo-1.git and git://example.com/foo/bar/repo-2.git inside the folder backups/git.
Added new SCM Syncers: SVN and Git
fixed issue in ruby 1.8.7 - File.absolute_path
I detected a small issue in 1.8.7 - apologies! Test added and fix submitted.
Looks good. What do you think @burns? Also, do you feel that any of the other pull requests should be merged in before a new gem release?
Wondering if there are any plans to add SVN/Git support to the backup gem (like this pull req, or otherwise)...
I monkey-patched a custom provider for our internal git hosting servers to push the bare repositories to additional remotes on a backup server. Unfortunately I wrote it against 3.0.19 and it seems that 9be16f7 reorganized things substantially such that my monkey-patching no longer works with newer versions of the gem.
Why svnsync instead of svnadmin hotcopy? I don't know the semantics of the former, but the latter allows the repository to be active during the backup; that is, it won't lose transactions in-flight. But, it's been a long time since I looked at backing up svn repositories; I'm probably out of date.
I'm not certain why we used svnsync, but I'm sure we knew svnadmin existed and yet we used svnsync. But it has been years since I have had to use these, I'm afraid I have forgotten the details. I'd venture it has to do with the permissions required for each action. But that's a guess.
I've skimmed some docs; maybe svnsync because it can operate remotely, whereas svnadmin hotcopy needs to operate locally? Flexibility I guess...? Except there are file:// URLs there, note remote ones. Shrug.
I'd really like for this to get merged; I discovered backups (!) recently, and I wanted exactly this, to be able to back up svn repositories.
Adding mercurial (Hg) will be perfect :)
Looks solid. 👍
What should be done to get this pull request merged?
The problem with this PR is that is has gone untouched for too long. It's from Feb 16, 2012 and all of its changes are based on the 3.0.2x version it branched off from, the 3.0 version is now at 3.11.0. I will close this PR as it is now unmergable. If someone wants to re-add this feature (for 3.0 or 4.0) please submit a new PR and we will take a look at it sooner.
Feb 16, 2012