简体   繁体   English

通过FTP将SVN存储库导出到远程服务器

[英]Export SVN repository over FTP to a remote server

I'm using following command to export my repository to a local path: 我正在使用以下命令将我的存储库导出到本地路径:

svn export --force svn://localhost/repo_name /share/Web/projects/project_name

Is there any, quite easy (Linux newbie here) way to do the same over FTP protocol, to export repository to a remote server? 是否有通过FTP协议进行存储库导出到远程服务器的简单方法(此处是Linux新手)?

Last parameter of svn export AFAIK have to be a local path and AFAIK this command does not support giving paths in form of URLs, like for example: svn export AFAIK的最后一个参数必须是本地路径,并且AFAIK该命令不支持以URL形式提供路径,例如:

ftp://user:pass@server:path/

So, I thing there should be some script hired here to do the job. 所以,我觉得这里应该雇用一些脚本来完成这项工作。

I have asked some people about that, and was advised that the easiest way is to export repository to a local path, transfer it to an FTP server and then purge local path. 我曾问过一些人,并被告知最简单的方法是将存储库导出到本地路径,将其传输到FTP服务器,然后清除本地路径。 Unfortunately I failed after first step (extract to local path! :) So, the support question is, if it can be done on-the-fly, or really have to be split into two steps: export + ftp transfer? 不幸的是,我在第一步(提取到本地路径!)后失败了,所以,支持的问题是,它可以即时完成,还是必须分为两个步骤:export + ftp transfer?

Someone also advised me to setup local SVN client on remote server and do simple checkout / update from my repository. 有人还建议我在远程服务器上设置本地SVN客户端,并从存储库中进行简单的签出/更新。 But this is solution possible only if everything else fails. 但这只有在其他所有方法都失败的情况下才可能解决。 As I want to extract pure repository structure, without SVN files, which I would get, when go this way. 因为我想提取不带SVN文件的纯存储库结构,所以用这种方法可以得到。

BTW: I'm using QNAP TS-210, a simple NAS device, with very limited Linux on board. 顺便说一句:我正在使用QNAP TS-210,这是一种简单的NAS设备,板载Linux十分有限。 So, many command-line commands as good as GUI are not available to me. 因此,我无法使用许多与GUI一样的命令行命令。

EDIT : This is second question in my "chain". 编辑 :这是我的“链条”中的第二个问题。 Even, if you help me to succeed here, I won't be able to automate this job (as I'm willing to) without your help in question " SVN: Force svn daemon to run under different user ". 即使,如果您帮助我在这里取得成功,如果没有问题“ SVN:强制svn守护程序在其他用户下运行 ”的帮助,我也将无法自动执行此工作(如我所愿)。 Can someone also take a look there, please? 有人可以看看吗? Thank you! 谢谢!

Well, if you're using Linux, you should be able to mount an ftpfs . 好吧,如果您使用的是Linux,则应该能够安装ftpfs I believe there was a module in the Linux kernel for this. 我相信Linux内核中有一个用于此的模块。 Then I think you would also need FUSE. 那我想您也需要保险丝。

Basically, if you can mount an ftpfs , you can write your svn export directly to the mounted folder. 基本上,如果您可以挂载ftpfs ,则可以将svn导出直接写到已挂载的文件夹中。

not sure about FTP, but SSH would be a lot easier, and should have better compression. 不确定FTP,但是SSH会容易得多,并且应该具有更好的压缩率。 An example of sending your repo over SSH may look like: 通过SSH发送存储库的示例如下所示:

svnadmin dump /path/to/repository |ssh -C username@servername 'svnadmin -q load /path/to/repository/on/server' svnadmin dump / path / to / repository | ssh -C username @ servername'svnadmin -q load / path / to / repository / on / server'

URL i found that info was on Martin Ankerl's site 我发现该网址位于Martin Ankerl的网站上的URL

[update] [更新]

based on the comment from @trejder on the question, to do an export over ssh, my recomendation would be as follows: 根据@trejder对问题的评论,要通过ssh进行导出,我的建议如下:

svn export to a folder locally, then use the following command: svn导出到本地文件夹,然后使用以下命令:

cd && tar czv src | cd && tar czv ​​src | ssh example.com 'tar xz' ssh example.com'tar xz'

where src is the folder you exported to, and example.com is the server. 其中src是导出到的文件夹,example.com是服务器。

this will take the files in the source folder, tar and gzip them and send them over ssh, then on ssh, extract the files directly to the machine.... 这将把源文件夹中的文件,tar和gzip压缩并通过ssh发送,然后在ssh上,将文件直接提取到计算机中。

前阵子写的-也许在这里有用exup

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM