ftp传输rsync方式

发布于 2024-07-09 14:07:53 字数 166 浏览 4 评论 0原文

我经常从 ftp 服务器下载日志文件(顺便说一句,我无法控制它),而且每次都下载整个文件似乎很麻烦。

所以我正在寻找一个程序(linux-ish)或Perl模块,它以某种方式结合了ftp和rsync,并且只“更新”文件。

日志文件不断增长。

周围有类似的吗?

I'm downloading a logfile quite often from a ftp-server (which I'm not in control over, btw), and it seems rather rediciolus to download the whole file every time.

So I'm looking for a program (linux-ish) or Perl module that in a way combines ftp and rsync, and only "updates" the file.

The logfile is constantly growing.

Anything like that around?

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

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

发布评论

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

评论(3

北陌 2024-07-16 14:07:53
Install curlftpfs (if on Windows, use cygwin)

# Create local mount path
mkdir -p /mnt/myftp

# Mount the destination ftp site using curlftpfs
curlftpfs -o allow_other ftp://myusername:[email protected] /mnt/myftp

# rsync inplace using append option
# use a long timeout value as the first long phase
# (the inplace comparison) takes a while
rsync -rzvvv --inplace --append --progress --stats --timeout=7200 /mnt/myftp/path/to/source/file.log /path/to/local/destination/file.log

# When you need to umount the ftp site
sudo umount myftp

# You can also mount from /etc/fstab by appending the following line
# curlftpfs#myusername:[email protected] /mnt/myftp fuse allow_other,rw,user,noauto 0 0

# References:
# http://linux.byexamples.com/archives/344/mounting-ftp-host-to-local-directory-on-top-of-fuse/
# http://lists.samba.org/archive/rsync/2007-May/017762.html
Install curlftpfs (if on Windows, use cygwin)

# Create local mount path
mkdir -p /mnt/myftp

# Mount the destination ftp site using curlftpfs
curlftpfs -o allow_other ftp://myusername:[email protected] /mnt/myftp

# rsync inplace using append option
# use a long timeout value as the first long phase
# (the inplace comparison) takes a while
rsync -rzvvv --inplace --append --progress --stats --timeout=7200 /mnt/myftp/path/to/source/file.log /path/to/local/destination/file.log

# When you need to umount the ftp site
sudo umount myftp

# You can also mount from /etc/fstab by appending the following line
# curlftpfs#myusername:[email protected] /mnt/myftp fuse allow_other,rw,user,noauto 0 0

# References:
# http://linux.byexamples.com/archives/344/mounting-ftp-host-to-local-directory-on-top-of-fuse/
# http://lists.samba.org/archive/rsync/2007-May/017762.html
聆听风音 2024-07-16 14:07:53

“恢复下载”不适用于您的情况吗?

假设您上次的传输被中止,然后从停止的地方重新开始下载

Wouldn't "resume download" work for your case?

Just pretend your transfer was aborted last time and restart downloading from where you stop

第七度阳光i 2024-07-16 14:07:53

正如如何通过 FTP 使用 rsync 中所述,lftp 有镜像模式,同步效率远高于curftpfs+rsync

As said in How to use rsync over FTP, lftp has a mirror mode that makes syncing far more efficient than curlftpfs+rsync

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