LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 12-31-2007, 08:34 AM   #1
its_joy
LQ Newbie
 
Registered: Dec 2007
Posts: 6

Rep: Reputation: 0
Exclude function On rsync command


Hello,

one of our server have backup drive on which do take monthly and weekly backups.

We do use rsync command for it.

Most of domains have bad folders and files which are particular.

So we would like to know using "rsync" command how can I exclude multiple files and folders.

Thank you
its_joy
 
Old 12-31-2007, 02:14 PM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
Here's a great write up on rsync. The second link is the shortcut to the exclude patterns:

http://www.ss64.com/bash/rsync.html

http://www.ss64.com/bash/rsync.html#exclude

Peace,
JimBass
 
Old 01-17-2008, 11:34 AM   #3
its_joy
LQ Newbie
 
Registered: Dec 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Hi JimBass,

Thanks for the great reply and that URL.

We have some query which I am mentioning below.

We want to exclude some directories in one command of rsync if this is possible than please let us know one example of it.

Currently we drop the folders using sed command for e.g below.
sed "/squid2/d"
We do collect the files and folders by dropping the unwanted using sed and than we do rsync of remaining one.

If there is any command for rsync which can exclude the multiple folders than let us know.

Thank you
its_joy
 
Old 01-17-2008, 09:35 PM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
I don't understand the problem. You can exclude 1000 things if you want, just either put all the exclusions in one massive string, or repeat the exclude command as many times as needed.

Peace,
JimBass
 
Old 01-18-2008, 01:40 AM   #5
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
How about --exclude-from=FILE

That's stright from the manpage
 
Old 01-18-2008, 05:25 AM   #6
its_joy
LQ Newbie
 
Registered: Dec 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for update.

I just need the command which can exclude multiple directories.

Suppose I want to rsync data of /home directory of one server to different server and I want to exclude some multiple directories which are present in many users home directory than what command should we use?

Hope you got the problem now
Its_joy
 
  


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
help with rsync exclude syntax please JacekZ Linux - General 2 07-08-2007 02:23 PM
What files to exclude when using rsync TongueTied Linux - General 2 07-20-2006 09:39 PM
can't get rsync exclude files Batta Linux - Newbie 1 03-27-2006 11:39 PM
rsync exclude list steelhead79 Linux - Software 3 01-14-2005 01:10 PM
Using the exclude option absolutely with rsync karlovac Programming 0 03-01-2004 01:39 PM


All times are GMT -5. The time now is 08:54 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