Re: Question on rsync with --exlude/--include



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.





.



Relevant Pages

  • RE: Windows Service Pack 2 Error
    ... I installed SP3 last night with no major problems. ... download SP2 again, and it STOPPED AGAIN 3/4 of the way through! ... Open a Run command and type in: ... regsvr32 wuweb.dll ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Help..mssecure.cab not updating!
    ... verify that your synctask is INFACT running without any issues? ... catalog, you should remove the unattend switch from the sync cmdline. ... > have the synch utility to download the catalog on a weekly basis. ... > Command line specified package to update on DPs as XYZ00010 ...
    (microsoft.public.sms.admin)
  • Re: Cant download SP2 to save........
    ... I had hoped I could just download it, burn it to a CD and save it. ... What does a TRACERT to download.microsoft.com give you? ... first router, from the first router to the next and so on until you reach ... To trace a path by using the tracert command ...
    (microsoft.public.windowsxp.basics)
  • RE: Windows Service Pack 2 Error
    ... advice concerning the Hard drive space, which I didn't know about from you. ... download SP2 again, and it STOPPED AGAIN 3/4 of the way through! ... Open a Run command and type in: ... regsvr32 wuweb.dll ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: self-autoupdate vb exe
    ... I have two exe files...the main executable and another file I call ... TpaPhx.exe and it operates only with a valid command line. ... same folder on my server as the updated file to download. ... the update as MyApp.exe and the phx script into the same directory. ...
    (microsoft.public.vb.winapi)