Networking Forums

Networking Forums > Computer Networking > Linux Networking > Exclusion of files in rsync with or without wildcards?

Reply
Thread Tools Display Modes

Exclusion of files in rsync with or without wildcards?

 
 
Matthew Lincoln
Guest
Posts: n/a

 
      05-24-2008, 10:05 AM
I want to exclude some files from being synced with rsync. I have to exclude them with
the --exclude option but with or without wirldcards?

In other words should I write:

rsync .... --exclude=/home/mylog* ....

or just:

rsync .... --exclude=/home/mylog ....

when I want to exclude all the files:

/home/mylog05
/home/mylog04
/home/mylog03

The manual for rsync does not give this information

Matthew
 
Reply With Quote
 
 
 
 
Roby
Guest
Posts: n/a

 
      05-24-2008, 12:44 PM
Matthew Lincoln wrote:

> I want to exclude some files from being synced with rsync. I have to
> exclude them with the --exclude option but with or without wildcards?
>
> In other words should I write:
>
> rsync .... --exclude=/home/mylog* ....
>
> or just:
>
> rsync .... --exclude=/home/mylog ....
>
> when I want to exclude all the files:
>
> /home/mylog05
> /home/mylog04
> /home/mylog03
>
> The manual for rsync does not give this information
>
> Matthew


I'm making my way along the rsync learning curve too. I don't
know the answer to your question, but why not try a dry run or
two:

rsync -n ...
or
rsync --dry-run ...


 
Reply With Quote
 
Time Waster
Guest
Posts: n/a

 
      05-27-2008, 08:25 PM
In article <4837e872$0$6604$(E-Mail Removed)>,
Matthew Lincoln <(E-Mail Removed)> wrote:
>
>
>I want to exclude some files from being synced with rsync. I have to
>exclude them with
>the --exclude option but with or without wirldcards?
>
>In other words should I write:
>
>rsync .... --exclude=/home/mylog* ....


Use --exclude '/home/mylog*' ...
You can have as many exclude clauses as you want.

I agree, the man page isn't great.

>
>or just:
>
>rsync .... --exclude=/home/mylog ....
>
>when I want to exclude all the files:
>
>/home/mylog05
>/home/mylog04
>/home/mylog03
>
>The manual for rsync does not give this information
>
>Matthew



 
Reply With Quote
 
James Taylor
Guest
Posts: n/a

 
      06-06-2008, 10:55 AM
Time Waster <(E-Mail Removed)> wrote:

> Matthew Lincoln <(E-Mail Removed)> wrote:
>
> >In other words should I write:
> >
> >rsync .... --exclude=/home/mylog* ....

>
> Use --exclude '/home/mylog*' ...


Correct, putting quotes around the name prevents the shell expanding the
star into a list of files before rsync reads it. With the quotes, rsync
sees the star and can apply that as a wildcard match itself.

> You can have as many exclude clauses as you want.


You can also put a file called .rsync-filter into the source directory
and then you can use the -F option to rsync instead of listing the
exclude rules on the command line every time. This is easier if you have
to sync often, and you don't have to worry about the shell doing
anything funny with wildcards.

> I agree, the man page isn't great.


It's very long and a little verbose, but not lacking in detail.

--
James Taylor
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get log file for rsync operation? Does rsync also delete remote files? Goran Ivanic Linux Networking 9 05-05-2008 04:58 PM
rsync says some files can not be transferred linq936@hotmail.com Linux Networking 1 09-28-2006 09:32 PM
RSync: move 'deleted' files to a specific folder Vincent Lascaux Linux Networking 2 09-11-2006 12:59 PM
rsync *only* files with no namesake on the destination dmorgan1 Linux Networking 1 06-24-2005 11:50 PM
Which is fastest program for copying files over network e.g rcp, ftp, scp, rsync David Travers Linux Networking 7 12-02-2004 11:58 PM



1 2 3 4 5 6 7 8 9 10 11