7

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:

--only-missing
--only-newer

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

1
  • 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. Apr 24, 2016 at 22:32

1 Answer 1

17

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.

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

You must log in to answer this question.

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