TAR syntax

TAR syntax

Post by Harry Kroon » Sat, 06 Jan 2001 22:03:51



Hello to all,

Open BSD 2.8,

from man TAR :

     tar [-]{crtux}[-befhmopqvwzHLOPXZ014578] [archive] [blocksize]
[-C directory] [-T file] [-s replstr] file1 [file2 ...]

     -c         Create new archive, or overwrite an existing
                archive, adding the specified files to it.

     -f archive Filename where the archive is stored.  Defaults to
                /dev/rst0.

     -T file    This is a positional argument which reads the names
                of files to archive or extract from the given file.

the command:

        tar -c -f destination.tar -T filelist

gives me

        illegal option --T

What am I doing wrong?

Harry Kroonen

 
 
 

TAR syntax

Post by anon » Sat, 06 Jan 2001 23:45:37


Just do this:

tar -czvf mytar.tgz file1 file2 file3

or

tar -czvf mytar.tgz *

The 'v' is optional...


> Hello to all,

> Open BSD 2.8,

> from man TAR :

>      tar [-]{crtux}[-befhmopqvwzHLOPXZ014578] [archive] [blocksize]
> [-C directory] [-T file] [-s replstr] file1 [file2 ...]

>      -c         Create new archive, or overwrite an existing
>                 archive, adding the specified files to it.

>      -f archive Filename where the archive is stored.  Defaults to
>                 /dev/rst0.

>      -T file    This is a positional argument which reads the names
>                 of files to archive or extract from the given file.

> the command:

>         tar -c -f destination.tar -T filelist

> gives me

>         illegal option --T

> What am I doing wrong?

> Harry Kroonen


 
 
 

TAR syntax

Post by Harry Kroon » Sun, 07 Jan 2001 00:45:08


I *really* want to use the -T option.

The TAR is one step in a backup script, and the to-be-tarred files are
not in a logical system. Rougly speaking:

find {modified files} > list1.txt
find {more files} >> list1.txt
grep -v {not these files} list1.txt > list2.txt
tar -T list2.txt

Harry

PS. this script ran ok on FreeBSD. ;-(

===============================


>Just do this:

>tar -czvf mytar.tgz file1 file2 file3

>or

>tar -czvf mytar.tgz *

>The 'v' is optional...


>> Hello to all,

>> Open BSD 2.8,

>> from man TAR :

>>      tar [-]{crtux}[-befhmopqvwzHLOPXZ014578] [archive] [blocksize]
>> [-C directory] [-T file] [-s replstr] file1 [file2 ...]

>>      -c         Create new archive, or overwrite an existing
>>                 archive, adding the specified files to it.

>>      -f archive Filename where the archive is stored.  Defaults to
>>                 /dev/rst0.

>>      -T file    This is a positional argument which reads the names
>>                 of files to archive or extract from the given file.

>> the command:

>>         tar -c -f destination.tar -T filelist

>> gives me

>>         illegal option --T

>> What am I doing wrong?

>> Harry Kroonen

 
 
 

TAR syntax

Post by Kovacs Rob » Sun, 07 Jan 2001 02:34:52


hemoT$ pwd
/tmp/tmp
hemoT$ touch a b c
hemoT$ find `pwd`/ | grep -v "\/$" > ../A
hemoT$ tar cf a.tar -T ../A
tar: Removing leading / from absolute path names in the archive
hemoT$ ls
a     a.tar b     c
hemoT$ tar tf a.tar
tmp/tmp/a
tmp/tmp/b
tmp/tmp/c

good luck
r


> Hello to all,

> Open BSD 2.8,

> from man TAR :

>      tar [-]{crtux}[-befhmopqvwzHLOPXZ014578] [archive] [blocksize]
> [-C directory] [-T file] [-s replstr] file1 [file2 ...]

>      -c         Create new archive, or overwrite an existing
>                 archive, adding the specified files to it.

>      -f archive Filename where the archive is stored.  Defaults to
>                 /dev/rst0.

>      -T file    This is a positional argument which reads the names
>                 of files to archive or extract from the given file.

> the command:

>         tar -c -f destination.tar -T filelist

> gives me

>         illegal option --T

> What am I doing wrong?

> Harry Kroonen

 
 
 

TAR syntax

Post by Christian Weisgerb » Sun, 07 Jan 2001 11:13:58



> the command:

>    tar -c -f destination.tar -T filelist

> gives me

>    illegal option --T

> What am I doing wrong?

Nothing.  tar is broken.
"-T" does happen to work if you use old-style bundled options otherwise:

    tar cf destination.tar -T filelist

--

 
 
 

TAR syntax

Post by Christian Weisgerb » Sun, 07 Jan 2001 11:20:36



> PS. this script ran ok on FreeBSD. ;-(

Hardly relevant, as FreeBSD uses a divergent branch of GNU tar
while OpenBSD has resorted to the tar personality of BSD pax.

This "read files to archive from file" feature is hardly standard.
Solaris tar uses "-I" for this, GNU tar introduced "-T".  The latest
test version of GNU tar now handles "-I" as an alias for "-T" as
well.

--

 
 
 

TAR syntax

Post by Harry Kroon » Tue, 09 Jan 2001 20:20:49





>> the command:

>>        tar -c -f destination.tar -T filelist

>> gives me

>>        illegal option --T

>> What am I doing wrong?

>Nothing.  tar is broken.
>"-T" does happen to work if you use old-style bundled options otherwise:

>    tar cf destination.tar -T filelist

Thanks. Works okay now.

Is someone gonna correct this in the man pages?

Harry

 
 
 

TAR syntax

Post by Christian Weisgerb » Tue, 09 Jan 2001 23:11:55



> >    tar cf destination.tar -T filelist

> Thanks. Works okay now.
> Is someone gonna correct this in the man pages?

It's not the man page that's broken, it's the implementation of
the "-T" switch.  Yes, this should be fixed.  I've added it to my
TODO list, but I don't know when I will get around to it.

--

 
 
 

TAR syntax

Post by Marc Esp » Wed, 10 Jan 2001 05:17:00





>> >    tar cf destination.tar -T filelist

>> Thanks. Works okay now.
>> Is someone gonna correct this in the man pages?

>It's not the man page that's broken, it's the implementation of
>the "-T" switch.  Yes, this should be fixed.  I've added it to my
>TODO list, but I don't know when I will get around to it.

Eric Jackson worked a bit on that as well prior to 2.8.
The only issue is that pkg_create/pkg_add is utterly dependent on tar -T
working (the flavor that's used by pkg_create/pkg_add anyways), and so any
fix had better not break that.

More to the point, what's needed is a clean-up of pax's option handling,
and more generally of pax itself. It's one of those brittle programs where
you don't know what a fix is going to break...

 
 
 

1. tar syntax question

Hi,

I'm trying to backup an AIX box using the following command:

find / -print | grep -v /netrs1/backup | tar cfL - >
/netrs1/backup/netrs1.tar 2> /netrs1/backup/netrs1.err

where netrs1 is the hostname, and /netrs1/backup is mounted on a remote box.

Anyway, what I'm trying to do is run tar on the / directory but exclude
directory /netrs1/backup. But the command I typed above doesn't work.
Could someone help me with the syntax please? (I'm using the AIX tar).

Thanks,

JS.

2. dial on demand to "PPP-only" ISP

3. Help with tar syntax please

4. Make-IT 486 success

5. Please help with tar syntax.

6. A Zoom Modem that works on Linux

7. tar syntax

8. bind wwwoffle to IP address

9. TAR SYNTAX & UNKNOWN DEVICE

10. Tar Syntax Question

11. tar syntax

12. help: tar syntax

13. find/tar syntax problem