Did I read this correctly in the LFTP man page for the mirror command?

--only-newer turns off file size comparison and uploads/downloads only newer files even if size is different. By default older files are transferred and replace newer ones.

By default, if I issue the command mirror / /local/folder, which mirrors the remote site to my local folder, it will replace my local file with a remote file if it is older than my local file?

Is this actually what LFTP does? Is that not backwards to what's useful?


You are correct in your understanding: by default, mirror will attempt to overwrite files -- even newer files -- with whatever you're downloading (or uploading, in the case of mirror -R).

Is that not backwards to what's useful?

It depends on your point of view. The idea of mirror-ing is to make an exact duplicate of the remote files/directories, regardless of what changes may have been made to the local files since the last time mirror was executed.

See also the xfer:clobber setting if you want a blunter way of ignoring all possible overwrite conflicts.

| improve this answer | |

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.