LinuxQuestions.org
Visit Jeremy's Blog.
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, 06:57 PM   #1
xeon123
Member
 
Registered: Sep 2006
Posts: 367

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, 07:24 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

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

Edit: Deleted obviously wrong content.

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

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, 08:01 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096
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-27-2011, 12:27 AM   #5
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,591

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

Evo2.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11:43 PM
rsync can not rsync files with include filter... xiutuo Linux - Server 2 07-23-2010 03:10 AM
Rsync exclude (or include) issue eyeprotocol Linux - General 1 02-10-2010 12:08 AM
rsync include/exclude problems toaster.waffle Linux - Software 4 11-19-2009 10:57 AM
include/exclude apps from panel linmix Fedora 6 01-23-2005 01:25 PM


All times are GMT -5. The time now is 03:13 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration