vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| On Thu, 21 Feb 2008 12:07:18 +0100, Peter Terpstra wrote: > > Dear readers, > > How can i exclude with the tar command a list of files ending > on .gz .deb .rpm .iso .zip an so on? tar --help gives (amongst other things); --exclude=PATTERN exclude files, given as a PATTERN -- Regards _ / ) "The blindingly obvious is / _)rad never immediately apparent" White people going to school, where they teach you to be thick White Riot - The Clash |
| |||
| Brad Rogers in <pan.2008.02.21.11.18.45.813936@abydos.stargate.or g.uk> : > tar --help gives (amongst other things); > > --exclude=PATTERN * * *exclude files, given as a PATTERN Yes i know, but how? tar cvf --exclude="*.gz *.cf *.txt *.sh *.conf *.db" test.tar etc Creates just a file with that name and ends in an error (tar: Error exit delayed from previous errors). P. -- mailto |
| |||
| * Peter Terpstra <peter@dharma.dyndns.invalid>: > Brad Rogers in <pan.2008.02.21.11.18.45.813936@abydos.stargate.or g.uk> : > > >> tar --help gives (amongst other things); >> >> --exclude=PATTERN Â* Â* Â*exclude files, given as a PATTERN That's not meant for multiple patterns. > tar cvf --exclude="*.gz *.cf *.txt *.sh *.conf *.db" test.tar etc Either use another option reading your patterns from a file or use multiple --exclude options, one for each pattern. -- Felix M. Palmen (Zirias) \ -PGP- <fmp@palmen.homeip.net> /"\ ASCII Ribbon web: http://zirias.ath.cx/ \ http://zirias.ath.cx/pub.txt \ / Campaign my open source projects: \ FP ED9B 62D0 BE39 32F9 2488 X Against HTML In http://zirias.ath.cx/?pg=pro \ 5D0C 8177 9D80 5ECF F683 / \ Mail And News |
| |||
| Hi there, On 2008-02-21, Peter Terpstra <peter@dharma.dyndns.invalid> wrote: > > Yes i know, but how? > > tar cvf --exclude="*.gz *.cf *.txt *.sh *.conf *.db" test.tar etc > > Creates just a file with that name and ends in an error (tar: Error exit > delayed from previous errors). > > P. the cvf parameter for tar expects the file name of the archive to follow the 'f' argument real close. ;-) All further options need to follow later, e.g. tar cvf test.tar --exclude="*.gz" etc The cvf is "old style" argument use and after giving the command options in that style, the arguments for thos options must follow directly after the option string in the order the option string specifies. Another example would be tar cvbf 20 /dev/rmt0 ... if a blocking factor is required for writing to tape for example. Alternatively, you can, of course, use new style options in almost any order you like: tar --create --file=test.tar --exclude="*.gz" --verbose etc The --exclude can only take one pattern, IIRC. So you might try to find a pattern that matches everything you want to exclude, have several --exclude options on the command line or create a file containing all exclude patterns, on per line, and then exclude from that: tar cvf test.tar --exclude-from=patternfile etc HTH Martin -- Martin Boening, mboen@t-online.de, Linux Registered User #258205 KERNEL: A part of an operating system that preserves the medieval traditions of sorcery and black art. |
| |||
| On Thu, 21 Feb 2008 12:07:18 +0100, Peter Terpstra wrote: > How can i exclude with the tar command a list of files ending > on .gz .deb .rpm .iso .zip an so on? man tar > TIA! HTH! -- "Ubuntu" -- an African word, meaning "Slackware is too hard for me". |
| |||
| Martin Boening in <fpk1qe$fpk$02$1@news.t-online.com> : > The --exclude can only take one pattern, IIRC. So you might try to find a > pattern that matches everything you want to exclude, have several > --exclude options on the command line or create a file containing all > exclude patterns, on per line, and then exclude from that: > tar cvf test.tar --exclude-from=patternfile etc Thank you very much, this was what i was looking for. Peter -- mailto |
| ||||
| On Thu, 21 Feb 2008 18:10:29 +0100, Peter Terpstra wrote: >> man tar > I read the manpages for more than seven years now and i'm still not good at > them. Seven years, eh? That's quite a while, especially for the 'tar' command. Whatever you do, don't try reading the manpage for 'bash'. You might explode. At least you're trying. Keep after it. -- "Ubuntu" -- an African word, meaning "Slackware is too hard for me". |