Modern Command Line Tool for FTP Backups
TL;DR: The convenient CLI-based FTP mirroring tool you wished for (hopefully, lol).
In my previous blog post, I presented lftp
as my CLI tool of choice in 2024 to connect to FTP servers to perform a parallel recursive download with FTPS (FTP over TLS). However, lftp
is a powerful low-level building block, and you need to know how to use it to mirror a directory via FTP. I created a small convenient bash script wrapper around FTP, optimized for that use-case. The script comes with all the convenient CLI argument parsing that one expects in 2024. I hope this might help others out there, or at least serve as base or inspiration for individual solutions.
My ftp-backup
script uses argc for modern argument handling in bash scripts. $ ftp-backup --help
prints:
You can find its source code as part of my NixOS config on GitHub. It is possible to use this script on non-NixOS systems, as long as lftp
, argc
, ansi
, and lftp
are in PATH
.
0 Comments