Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to mirror a directory using lftp but I want to exclude certain subdirectories.

I tried

mirror -R -e -x ^\.svn$ /documents/ /test

and

mirror -R -e -x /^\.svn$/ /documents/ /test

but neither of them excluded the .svn directories.

share|improve this question

2 Answers 2

I'm using

--exclude /\..+/$

to exclude all folders starting with a dot.

share|improve this answer
up vote 4 down vote accepted

mirror -R -e -x ^\.svn$ /documents/ /test is just fine.

The trick is, as .svn is a directory it will only be matched by a pattern that ends in a slash:

mirror -R -e -x ^\.svn/$ /documents/ /test

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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