LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Exclude function On rsync command (https://www.linuxquestions.org/questions/linux-server-73/exclude-function-on-rsync-command-610128/)

its_joy 12-31-2007 07:34 AM

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

JimBass 12-31-2007 01:14 PM

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

its_joy 01-17-2008 10:34 AM

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

JimBass 01-17-2008 08:35 PM

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

billymayday 01-18-2008 12:40 AM

How about --exclude-from=FILE

That's stright from the manpage

its_joy 01-18-2008 04:25 AM

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


All times are GMT -5. The time now is 11:44 AM.