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?
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:mypassword@ftp.mydomain.com /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:mypassword@ftp.mydomain.com /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
Wouldn't "resume download" work for your case?
Just pretend your transfer was aborted last time and restart downloading from where you stop
As said in How to use rsync over FTP, lftp has a mirror mode that makes syncing far more efficient than curlftpfs+rsync
I think you are trying to get rsync features out of ftp and it's not going to work easily.
I'd recommend a pure rsync solution.