java实现ftp svn,通过FTP将SVN存储库导出到远程服务器

这篇博客讨论了如何将SVN仓库通过SSH协议导出到远程服务器,而不是使用FTP。作者是一个Linux新手,尝试将svn export命令与FTP结合但遇到了困难。建议使用SSH,提供了一个例子:先使用svn export导出到本地,然后用tar和ssh将文件压缩并传输到远程服务器。由于作者的设备QNAPTS-210功能有限,某些命令行工具不可用,因此需要寻找适合的替代方案。
摘要由CSDN通过智能技术生成

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?

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:

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. 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?

Someone also advised me to setup local SVN client on remote server and do simple checkout / update from my repository. 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.

BTW: I'm using QNAP TS-210, a simple NAS device, with very limited Linux on board. So, many command-line commands as good as GUI are not available to me.

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". Can someone also take a look there, please? Thank you!

解决方案

not sure about FTP, but SSH would be a lot easier, and should have better compression. An example of sending your repo over SSH may look like:

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

[update]

based on the comment from @trejder on the question, to do an export over ssh, my recomendation would be as follows:

svn export to a folder locally, then use the following command:

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

where src is the folder you exported to, and example.com is the server.

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....

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值