On Mon, Sep 30, 2002 at 10:14:42PM +1000, Andrew Nelson wrote:
> Hi,
> 
> I'm having trouble using tar with simple exclusion
> rules..  I'd like to be able to run something like this:
> 
> tar cfvzp etc-backup.tgz /etc/
> 
> but exclude all *.gz files. I can only the --exclude syntax
> of tar if I leave off the -vzp options.  Why doesn't the
> following work?
> 
> tar cfvzp --exclude="*.gz" usr-backup.tgz /etc/

I have found that tar only accepts any options after the initial
ones if the initial ones are specified in the canonical way,
using a dash.  That is, I believe the following should work:

tar -cfvzp usr-backup.tgz --exclude="*.gz" /etc/

Besides, as someone else pointed out, the 'f' in the option string
specifies that the next argument is a filename; so put the filename
next :)

G'luck,
Peter

-- 
Peter Pentchev  [EMAIL PROTECTED]        [EMAIL PROTECTED]
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
This inert sentence is my body, but my soul is alive, dancing in the sparks of your 
brain.

Attachment: msg37149/pgp00000.pgp
Description: PGP signature

  • ... Andrew Nelson
    • ... Peter Pentchev
    • ... Александр Попков

Reply via email to