Re: Question on rsync with --exlude/--include
- From: birre <spamtrap@xxxxxxxxxxxx>
- Date: Tue, 29 Jan 2008 16:07:23 +0100
On 2008-01-29 15:55, user@xxxxxxxxx wrote:
Greets,
I'm trying to sync down certain types of packman rpm's
but not others. Should something like this work?
rsync -vid --progress \
--exclude *.rpm \
--include *lib*.rpm \
--include *-dev*.rpm \
--delete-after \
I'm after system packages and want to filter out some
huge game files etc.
TIA
Hi.
One thing you must know about in unix/linux is that the shells expand wildcards
BEFORE they are sent to the command, and NOT as in windows, where the command itself handles them (different depending on the program)
So , if your command line is rsync --exclude *.rpm , the shell will expand this
with a list of files in your current directory that match, so you end of with a
broken command.
You must protect them from the shell. '*.rpm' or \*.rpm .
a quick example:
cd test
bash # to make it more linux alike, I use Solaris :-)
bash-3.00$ touch ../testfile{1..9}
bash-3.00$ rsync -av --exclude testfile8 0:testfile\* .
receiving file list ... done
testfile1
testfile2
testfile3
testfile4
testfile5
testfile6
testfile7
testfile9
/bb
.
- Follow-Ups:
- References:
- Question on rsync with --exlude/--include
- From: user
- Question on rsync with --exlude/--include
- Prev by Date: Question on rsync with --exlude/--include
- Next by Date: Re: Trying to install Fedora 7 and 8
- Previous by thread: Question on rsync with --exlude/--include
- Next by thread: Re: Question on rsync with --exlude/--include
- Index(es):