I would like to know if it was possible to download all latest files on an ftp server with lftp without downloading the older files.


On my server I have


On my computer:


If I delete /order/3058, the script must not download it again.

I would like to download all /order/{id} as they become available. But, these change everyday and I don't want to download all order/{id} each time, only the latest.

The particularity is my server is secured with SSL and I need this to connect

set ftp:ssl-force true
set ftp:ssl-protect-data true
set ssl:verify-certificate false

1 Answer 1


No, lftp does not do exactly what you are asking. That would make it necessary for lftp to remember the previous updates. Instead, its mirror feature provides these scenarios which rely only upon a comparison of the current directory contents:

  • download all updates
  • download updates, while deleting local files which no longer exist on the remote server.

However (if you maintain a list of local deletions which can be applied to a script), lftp has an option for excluding files:

-X GP, --exclude-glob= GP
exclude matching files

Include and exclude options can be specified multiple times. It means that a file or directory would be mirrored if it matches an include and does not match to excludes after the include, or does not match anything and the first check is exclude. Directories are matched with a slash appended.

Using the -X option, lftp could do what you want, but only with some work on your part.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .