The curlftpfs utility can be used to “mount” the directory of an FTP server. Together with other tools like rsync you can get a fine-grained and easy access via the command line with the possibility of scripting. This document describes installtion, use, and critique this approach.
Dealing with FTP servers can be tedious with the ftp
command. Partially improved are tools like ncftp
, lftp or sftp
. Some FTP servers offer rsync-module support, and rsync can be used to partially download an FTP site. However, the local admin would have to know in advance that a certain part of the FTP server is of special interest and predefine a rsync-module. Usually this is not the case for exactly the part you want to download.
In this cases curlftpfs can be used.
Debian | Code | Version |
---|---|---|
9 | Stretch | 0.9.2-9+b1 |
10 | Buster | 0.9.2-9+b1 |
11 | Bullseye | 0.9.2-9+b1 |
To avoid using curlftpfs, you should check if the part of the FTP server is already available via a rsync-module.
Partly root rights are needed
Installation is straightforward and there are no special requirements or dependencies.
aptitude install curlftpfs
No configuration is required. To recursively copy a portion of an FTP server, the following steps can be used.
mkdir /tmp/mnt
curlftpfs -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.2 | 2023-04-04 | Improve writing, fix spelling curlftpfs |
0.1.1 | 2022-06-27 | Improve wording, grammar; shell->bash |
0.1.0 | 2021-05-04 | Initial release |