The tool curlftps can be used to “mount” the directory of an FTP server. Together with other tools like rsync, one can obtain a fine grained and easy access via the command line with the possibility of scripting. This document describes, installation, usage and critique of this approach.
Dealing with FTP servers can be tedious with the ftp command. Partly improved are tools like ncftp, lftp or sftp. Some FTP server offer rsync-module support and rsync can be used to partially download a FTP side. However the local admin would need to know in advance that a certain part of the FTP server is of special interest and pre-define a rsync-module. Usually this is not the case for exactly the part one wishes to download.
In this cases curlftps can be used.
The installation is straight forward and special prerequisites or dependencies are not needed.
aptitude install curlftps
A configuration is not needed. To recursively copy a part of an FTP server the following steps can be used.
mkdir /tmp/mnt
curlftps -o allow_other ftp://myusername:mypassword@ftp.domain.tld /tmp/mnt
mkdir /tmp/dst
cd /tmp/dst
rsync -rzv --inplace --append --progress --stats --timeout=7200 /tmp/mnt/somedir .
sudo umount /tmp/mnt
| Version | Date | Notes |
|---|---|---|
| 0.1.1 | 2022-06-27 | Improve wording, grammar; shell->bash |
| 0.1.0 | 2021-05-04 | Initial release |