I usually edit my website locally and push it with this command:

lftp -u user,password host -e "mirror -c -e -R -x ^\.git/$ my /my; exit"

But now, my website dynamically appends data to the /my/data file.

I don't have this /my/data file locally.

QUESTION: How to push without deleting /my/data and its content?


  • I could download /my/data and then run the command above, but data added in the few seconds before the download and the upload would get lost.
  • For the other files/folders, local deletion should be mirrored by a remote deletion.
  • I don't want to use --only-newer-like operations because clocks might not be adjusted.

Answer given by LFTP's maintainer:

Just exclude the folder using -x ^data/ option.

If you need to upload some local files into that folder, use two mirrors, one without -e option just for my/data folder.

  • How do I skip multiple files and directories?
    – Ikechukwu
    Sep 5 at 12:10
  • @Ikechukwu: I have not tried, but maybe multiple -x arguments? Sep 8 at 13:49

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.