I have same folder name in different sub-directories, but while mirroring I want to exclude specific folder only.

Example :

I have directory "123" in different directories


I want to exclude ./abc/123/ only, but if I use below command that exclude all occurance

lftp  -p 22 -e 'mirror --exclude ./abc/123/ './abc' '/var/www/' ; exit' sftp://user@domain.com

1 Answer 1


If ^\ is specified, only the top level seems to be excluded.

Example :

 ├ img/
 │ └ dummyA.png
 └ upload/
   └ img/
     └ dummyB.png

In case of the above directory structure

mirror --reverse -x ^\img/ --delete /home /site
 └ upload/
   └ img/
     └ dummyB.png

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.