svn服务器自动同步

发布于 2024-08-19 09:41:32 字数 168 浏览 3 评论 0原文

我在本地局域网上有一个 svn 服务器,它在 Windows 上。开发人员使用它并从中签入/签出。为了安全起见,我们从机架空间占用了一台 Linux 服务器。是否可以每周自动从本地 svn 服务器同步到远程服务器。远程的主要用作远程备份,但以防万一有人想要访问,那么他们就可以这样做,因为我们的局域网没有静态或外部 IP。

I have a svn server on our lan locally its on windows. The developers use and check in/out from that. Just to be on the safer side we have took up a server from rackspace a linux one. Is it possible to do an automatic weekly synchronise from the local svn server to the remote one. The remote one will be mainly used as a remote backup but just in case if somebody wants to access then they can do as there is no static or external IP for our lan.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦巷 2024-08-26 09:41:32

我建议使用 svnsync 。当从 post-commit 挂钩触发时,该工具(svn 发行版的一部分)允许 2 个(或更多)svn 服务器之间进行实时同步。

I would suggest to to use svnsync for this. When triggered from the post-commit hook, this tool (part of the svn distribution) allows for a live synchronization between 2 (or more) svn servers.

北方的巷 2024-08-26 09:41:32

只要备份服务器是只读的,像 rsync 这样的基本功能就应该可以工作。但是您可能想要实现一个重试循环,该循环不断同步直到没有任何内容可以同步,这样您就不会在某人提交某些内容时准确同步状态。

如果您需要在两个站点上进行读/写访问,那么使用 git 之类的东西并在客户端使用 git-svn 作为“向后兼容性”可能会更安全、更容易。

另一种选择是使用 SVK,这是一个构建在 SVK 之上的分布式版本控制系统。但这对客户来说也不会完全透明。

As long as the backup server is used read-only, something basic like rsync should work. But you might want to implement a retry loop that keeps syncing until there is nothing to sync, so that you don't sync a state exactly while someone is committing something.

If you need read/write access on both sites, it might be safer and easier to use something like git and use git-svn on the client side as "backward compatibility".

Another option is to use SVK, a distributed version control system built on top of SVK. But that will also not be completely transparent to the clients.

可可 2024-08-26 09:41:32

您可以使用 svnadmin dump 转储整个存储库。
您可以使用 postcommit 挂钩和相同的命令以独立格式转储提交,以便稍后重新应用。

将这些与 rsync 结合起来,您可以在任何其他服务器上有效地复制您的服务器。只要您的备份服务器只能以只读方式访问,就可以使用它。在发生故障的情况下,一个简单的 svn 开关将允许您的开发人员使用备份服务器。

我建议您设置 acls 禁止写入备份服务器,除非它成为主人。

peter提到的另一个解决方案可能是svk,但它不能用于完全自动同步:如果两台服务器上的更改发生冲突会发生什么?该脚本将失败或破坏它。任何像分布式合并这样的事情都必须由人来审查。

另一种解决方案是 svn --mirror 方式

您应该尝试阅读此内容以获取有关保持存储库同步的更多详细信息: 如何同步两个 Subversion 存储库? :)

You can use svnadmin dump to dump a whole repository.
You can use a postcommit hook along with the same command to dump the commit in a standalone format that can be later reapplied

Combining these and rsync you can effectively replicate your server on any other server. AS long as your backup server is only accessed readonly it can be used. In the case of a failure, a simple svn switch will allow your developpers to use the backup server.

I would recommand you setup acls to forbid writing to the backup server unless it becomes the master.

Another solution as mentionned by peter could be svk, but that cannot be used for a complete automatic sync : what happens if there are conflicting changes made on both servers ? the script will fail or mangle this. Anything like distributed merge must be reviewed by a human.

Yet another solution would be the svn --mirror way

You should try to read this for more detailed information on keeping repos in sync: How to synchronize two Subversion repositories? :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文