Re: Question on rsync with --exlude/--include
- From: user@xxxxxxxxx
- Date: Tue, 29 Jan 2008 22:29:42 -0500
birre wrote:
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.
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
I should also have said that it's a bash script, which might make a difference.
Thanks. I've tried different combinations with \* and '*' but it always stops at "1 file to consider".
rsync -vid --progress \
--exclude \* \
--include lib\*.rpm \
--delete-after \
ftp5.gwdg.de::pub/opensuse/repositories/GNOME:/Community/openSUSE_10.3/i586/ /0/sa13/03-sus/upgr/ossrep-GNOME-i586
receiving file list ...
1 file to consider
sent 141 bytes received 195 bytes 14.93 bytes/sec
total size is 0 speedup is 0.00
On the other hand if I use something like
--exclude *debug*.rpm \
than it does filter out all debug files even with a naked * wildcard.
So isn't the problem that I'm trying to do what isn't provided for?
If I just use
--include lib\*.rpm \
that seems to have no effect at all, all files get downloaded. I would have expected --include to exclude everything else and run the whole
directory list with each switch incidence (???).
How can I code to download only files with lib in them, as an example?
I would actually want all files matching a short list of partly
wildcarded filenames like *dev*, *lib*, etc. Some sort of an
--exclude-unless is what I'm looking for.
.
- Follow-Ups:
- Re: Question on rsync with --exlude/--include
- From: birre
- Re: Question on rsync with --exlude/--include
- References:
- Question on rsync with --exlude/--include
- From: user
- Re: Question on rsync with --exlude/--include
- From: birre
- Question on rsync with --exlude/--include
- Prev by Date: Re: Ubuntu or Suse 10
- Next by Date: Re: debian backup
- Previous by thread: Re: Question on rsync with --exlude/--include
- Next by thread: Re: Question on rsync with --exlude/--include
- Index(es):
Relevant Pages
|