备份 SVN 服务器上所有代码和内容的最佳方法是什么?
有没有好的方法来备份SVN服务器上的所有代码和内容? 因为如果硬盘坏了,所有的工作都会丢失。
我认为如果我们使用多台计算机定期对其进行 SVN 更新,则大多数文件都存在于这些计算机上,因此代码会更安全,不会丢失。
我还考虑编写一个脚本将 c:\repositories
复制到 w:\
,这是一个 2TB 外部硬盘驱动器,白天大部分时间闲置。 复制过程可以通过 cron 或 Windows 调度程序每晚运行...但是复制所有内容会是一种矫枉过正吗? 一天中可能有十几个文件被更改,总共有 0.5MB,复制整个存储库可能需要 50MB 或更多。 如果我在 cron 作业运行时进行 SVN 签入怎么办? 这些文件不会处于不一致的状态吗?
或者将存储库放在 c:\
以便 SVN 更新很快(w:
驱动器如果闲置太久需要时间来唤醒),然后就可以了在 w:\
下创建一个项目,并将所有文件检出到 w:\all_code
,它将 SVN 更新到整个存储库,然后运行 cron 作业来 SVN 更新 < code>w:\ 每晚同步到存储库,以便所有文件的额外副本都在 w:
上?
is there a good way to back up all the code and content on an SVN server? because if that hard drive dies, then all work can be lost.
i think if we use multiple computers to SVN Update to it regularly, the most of the files are present on those machines, and therefore the code are somewhat safer not to be lost.
i was also thinking of writing a script to copy the c:\repositories
to w:\
, which is a 2TB external hard drive that is mostly idle during the day. the copy process can be run nightly by cron or windows scheduler... but will copying everything be an overkill? it may be a dozen files that got changed during the day, which total to be 0.5MB, and copying the whole repositories may involve 50MB or more. and what if i was doing SVN check-in while that cron job is running. won't those files be in an inconsistent state?
or what about have the repository at c:\
so that SVN update is fast (the w:
drive need time to wake up if idle for too long), and then just create a project under w:\
and check out all files to w:\all_code
and it will SVN update to the whole repository, and then run cron jobs to SVN update w:\
to sync to the repository every night, so that an extra copy of all the files are on w:
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您有多种选择:
svnadmin hotcopy:http://svnbook.red-bean.com/en/1.2/svn.ref.svnadmin.c.hotcopy.html
svnadmin 转储和 svnadmin 加载:http://svnbook.red-bean.com/en/1.2/svn.ref.svnadmin.c.dump.html
svnsync 创建存储库的只读镜像:http://svn.collab.net/repos/svn/trunk/notes/svnsync.txt
You have a number of options:
svnadmin hotcopy: http://svnbook.red-bean.com/en/1.2/svn.ref.svnadmin.c.hotcopy.html
svnadmin dump and svnadmin load: http://svnbook.red-bean.com/en/1.2/svn.ref.svnadmin.c.dump.html
svnsync to create a read-only mirror of your repository: http://svn.collab.net/repos/svn/trunk/notes/svnsync.txt
查看
命令。 http://svnbook.red-bean.com/en/1.1/re31。 html
check out the
command. http://svnbook.red-bean.com/en/1.1/re31.html
在 Google 中找到了此内容:
http://justinram.wordpress。 com/2006/05/03/subversion-server-windows-backup/
大多数点击都是针对 Linux 的,但那是针对 Windows 的特定答案。 请务必注意有关用户检出文件/更改文件的部分。
Found this in Google:
http://justinram.wordpress.com/2006/05/03/subversion-server-windows-backup/
Most hits were for for Linux, but that one is a Windows specific answer. Make sure you pay attention to the part about users having files checked out/changes to files.
获取热备份的副本。 py。
然后创建一个新的计划任务来每晚执行 python 脚本。
以下是我传递给脚本的示例:
此示例将存储库的 zip 备份创建到
\\core-ad01l\backup\
并最多保留 30 个备份。您需要安装 python 才能运行脚本。
Get a copy of hot-backup.py.
Then create a new Sheduled Task to execute the python script every night.
Here is an example of what I pass to the script:
This example creates a zip backup of the repository to
\\core-ad01l\backup\
and keeps a maximum of 30 backups.You need python installed to run the script.
如果您使用的是 Linux 服务器,则每周或每小时创建存储库快照。
或者
你可以去
创建它的 zip 后。
If you are on Linux server then create snapshots of repository weekly or hourly.
or
You can go for
After create the zip of it.