LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   include and exclude in rsync (https://www.linuxquestions.org/questions/linux-newbie-8/include-and-exclude-in-rsync-882925/)

xeon123 05-26-2011 05:57 PM

include and exclude in rsync
 
Hi,

I'm trying to copy files from my local directory to a remote site using rsync.
I want to include in the copy all the java files and exclude all the .svn directories, but I can't do it.

The command that I use is
Code:

rsync -av -e ssh --include=*.java --exclude=/.svn/ dir user@remote:~/
How can I do that?

TobiSGD 05-26-2011 06:24 PM

It would help if you post what actually is not working.

Edit: Deleted obviously wrong content.

xeon123 05-26-2011 06:27 PM

The problem is that the exclude and include filters are not working, and i don't understand why.

TobiSGD 05-26-2011 07:01 PM

After looking at your command and studying the manpage of rsync I come to the conclusion that this should work. I don't understand why this shouldn't work, too.

evo2 05-26-2011 11:27 PM

Have you tried reversing the order of the --include and --exclude flags and also quoting the the *.java (ie '*.java')?

Evo2.


All times are GMT -5. The time now is 10:51 AM.