LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-26-2011, 05:57 PM   #1
xeon123
Member
 
Registered: Sep 2006
Posts: 374

Rep: Reputation: 16
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?
 
Old 05-26-2011, 06:24 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
It would help if you post what actually is not working.

Edit: Deleted obviously wrong content.

Last edited by TobiSGD; 05-26-2011 at 07:00 PM. Reason: Deleted obvoiusly wrong content
 
Old 05-26-2011, 06:27 PM   #3
xeon123
Member
 
Registered: Sep 2006
Posts: 374

Original Poster
Rep: Reputation: 16
The problem is that the exclude and include filters are not working, and i don't understand why.
 
Old 05-26-2011, 07:01 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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.
 
Old 05-26-2011, 11:27 PM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

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

Evo2.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync: exclude and include filters? JosephS Linux - Software 1 02-03-2011 10:43 PM
rsync can not rsync files with include filter... xiutuo Linux - Server 2 07-23-2010 02:10 AM
Rsync exclude (or include) issue eyeprotocol Linux - General 1 02-09-2010 11:08 PM
rsync include/exclude problems toaster.waffle Linux - Software 4 11-19-2009 09:57 AM
include/exclude apps from panel linmix Fedora 6 01-23-2005 12:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration