I have the following command:

lftp -e 'mirror -R /local/backups /' -u username,password ftp://FTP_SERVER

this works fine, until I started cleaning the /local/backups folder. I'd like to upload new files to my FTP_SERVER without deleting those which don't exist locally anymore.

I've tried the additional flags:


but neither is working. Is it at all possible? I know rsync has such an option, but that doesn't work with FTP servers.

  • Yes, it doesn't look like mirror is the right thing. Possibly --skip-noaccess could work. Otherwise you might need to build an explicit file list rather than using -R. – Ralph Rönnquist Apr 24 '16 at 22:32

lftp mirror command does not remove files by default, only if you add -e or --delete options.

To confirm that, use mirror --dry-run option.

  • LFTP | Version 4.8.3 appears to have no --dry-run option – kevzettler Mar 25 '18 at 22:50
  • it's a mirror option, use it like this: lftp -c "mirror --dry-run ..." – lav Sep 25 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.