tar funzt nicht

Apache, Lighttpd, nginx, Cherokee
Post Reply
pelowi
Posts: 46
Joined: 2004-03-11 21:16
 

tar funzt nicht

Post by pelowi »

hallo, alle zusammen,

habe mir gestern einen neuen server aufsetzen lassen (den dritten) jedoch mit Linux 9 und Confixx. nun möchte ich AWStats installieren und komme aber nicht weiter, sozusagen schon beim ersten schritt:

habe die Datei gezogen und möchte sie nun entpacken mit dem Befehl:
tar -xfz awstats-6.4.tgz

Dann kommt folgende Fehlermeldung:
tar: z: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

habe auf meinen anderen Servern linux 8.2, und da funzt es, es zu entpacken. gibts da nun nen neuen Befhel zu entpacken???

wenn ich das z weg lasse, kommt folgendes:

# tar -xf awstats-6.4.tgz
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: Error exit delayed from previous errors
#

Hab glaub ein Brett vorm Kopf, oder es ist heut nicht mein Tag :-(
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: tar funzt nicht

Post by Joe User »

Syntax (Position/Reihenfolge der Optionen) beachten: tar xzf archive.tar.gz
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Roger Wilco
Posts: 5923
Joined: 2004-05-23 12:53
 

Re: tar funzt nicht

Post by Roger Wilco »

Joe User wrote:Syntax (Position/Reihenfolge der Optionen) beachten: tar xzf archive.tar.gz
Weiss eigentlich jemand, warum bei Parameterübergabe mit "-" die Reihenfolge eine Rolle spielt, während es ohne "-" egal ist?
Das soll heißen tar xfz archive.tar.gz funktioniert, während es mit "-" tar -xzf archive.tar.gz heißen muss. Warum? ;)
pelowi
Posts: 46
Joined: 2004-03-11 21:16
 

Re: tar funzt nicht

Post by pelowi »

ich sag ja nicht mein Tag heute, oder das Brett war übergroß.

danke
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: tar funzt nicht

Post by Joe User »

Roger Wilco wrote:Weiss eigentlich jemand, warum bei Parameterübergabe mit "-" die Reihenfolge eine Rolle spielt, während es ohne "-" egal ist?
Das dürfte an der Funktion/Verarbeitung des "-" der jeweiligen Shell liegen...
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
mausgreck
Posts: 84
Joined: 2005-03-19 17:22
 

Re: tar funzt nicht

Post by mausgreck »

Joe User wrote:Das dürfte an der Funktion/Verarbeitung des "-" der jeweiligen Shell liegen...
Nah... Die Shell macht zwar viele magische Sachen, wenn Quotes im Spiel sind, aber die Interpretation der Optionen bleibt immer noch dem jeweiligen Programm überlassen ('s wäre ja noch schöner...).

Es ist ganz einfach so, dass "old style options" und "short options" anders interpretiert werden (info tar).
[tom]
Posts: 656
Joined: 2003-01-08 20:10
Location: Berlin
 

Re: tar funzt nicht

Post by [tom] »

Roger Wilco wrote:Weiss eigentlich jemand, warum bei Parameterübergabe mit "-" die Reihenfolge eine Rolle spielt, während es ohne "-" egal ist?

Code: Select all

tar -xzf archiv.tgz
ist die Kurzschreibweise von

Code: Select all

tar -x -z -f archiv.tgz
Dabei ist -f eine der Optionen, die einen Parameter erwarten. Deswegen ist die Reihenfolge wichtig. Du könntest also auch

Code: Select all

tar -z -f archiv.tgz -x
schreiben.

Ich bezweifel allerdings, dass man ohne das - die Reihenfolge immer und beliebig tauschen kann. Versuch das mal mit einem zusätzlichen -C (habs nicht getestet).


[TOM]
Outlaw
Posts: 1500
Joined: 2002-12-04 10:22
Location: 4. Server von rechts, 2. Reihe von oben
 

Re: tar funzt nicht

Post by Outlaw »

tar: z: Cannot open: No such file or directory heisst ja nicht, daß er tar nicht finden kann, sondern daß er z nicht finden kann ....

Gruß Outi
mausgreck
Posts: 84
Joined: 2005-03-19 17:22
 

Re: tar funzt nicht

Post by mausgreck »

[TOM] wrote:Ich bezweifel allerdings, dass man ohne das - die Reihenfolge immer und beliebig tauschen kann. Versuch das mal mit einem zusätzlichen -C (habs nicht getestet).
Die C Optionen werden hintereinander ausgeführt, sind also logischerweise nicht vertauschbar. Aber das gilt natürlich für beide Modi:

Code: Select all

tar -C test2 -C test3 -c -f xxx.tar.gz x
ist äquivalent zu

Code: Select all

tar CCcf test2 test3 xxx.tar.gz x
Hier noch mal die info-pages:
Short Option Style

Most options also have a short option name. Short options start with
a single dash, and are followed by a single character, e.g. `-t' (which
is equivalent to `--list'). The forms are absolutely identical in
function; they are interchangeable.

The short option names are faster to type than long option names.

Short options which require arguments take their arguments
immediately following the option, usually separated by white space. It
is also possible to stick the argument right after the short option
name, using no intervening space. For example, you might write
`-f archive.tar' or `-farchive.tar' instead of using
`--file=archive.tar'. Both `--file=ARCHIVE-NAME' and `-f ARCHIVE-NAME'
denote the option which indicates a specific archive, here named
`archive.tar'.

Short options' letters may be clumped together, but you are not
required to do this (as compared to old options; see below). When short
options are clumped as a set, use one (single) dash for them all, e.g.
``tar' -cvf'. Only the last option in such a set is allowed to have an
argument(1)
.

When the options are separated, the argument for each option which
requires an argument directly follows that option, as is usual for Unix
programs. For example:

$ tar -c -v -b 20 -f /dev/rmt0

If you reorder short options' locations, be sure to move any
arguments that belong to them. If you do not move the arguments
properly, you may end up overwriting files.

---------- Footnotes ----------

(1) Clustering many options, the last of which has an argument, is a
rather opaque way to write options. Some wonder if GNU `getopt' should
not even be made helpful enough for considering such usages as invalid.
Und:
Old Option Style

_(This message will disappear, once this node revised.)_

Like short options, old options are single letters. However, old
options must be written together as a single clumped set, without
spaces separating them or dashes preceding them
(1). This set of
letters must be the first to appear on the command line, after the
`tar' program name and some white space; old options cannot appear
anywhere else. The letter of an old option is exactly the same letter
as the corresponding short option. For example, the old option `t' is
the same as the short option `-t', and consequently, the same as the
mnemonic option `--list'. So for example, the command `tar cv'
specifies the option `-v' in addition to the operation `-c'.

When options that need arguments are given together with the command,
all the associated arguments follow, in the same order as the options.

Thus, the example given previously could also be written in the old
style as follows:

$ tar cvbf 20 /dev/rmt0

Here, `20' is the argument of `-b' and `/dev/rmt0' is the argument of
`-f'.

On the other hand, this old style syntax makes it difficult to match
option letters with their corresponding arguments, and is often
confusing. In the command `tar cvbf 20 /dev/rmt0', for example, `20'
is the argument for `-b', `/dev/rmt0' is the argument for `-f', and
`-v' does not have a corresponding argument. Even using short options
like in `tar -c -v -b 20 -f /dev/rmt0' is clearer, putting all
arguments next to the option they pertain to.

If you want to reorder the letters in the old option argument, be
sure to reorder any corresponding argument appropriately.

This old way of writing `tar' options can surprise even experienced
users. For example, the two commands:

tar cfz archive.tar.gz file
tar -cfz archive.tar.gz file
are quite different. The first example uses `archive.tar.gz' as the
value for option `f' and recognizes the option `z'. The second
example, however, uses `z' as the value for option `f'--probably not
what was intended.


Old options are kept for compatibility with old versions of `tar'.

This second example could be corrected in many ways, among which the
following are equivalent:

tar -czf archive.tar.gz file
tar -cf archive.tar.gz -z file
tar cf archive.tar.gz -z file

As far as we know, all `tar' programs, GNU and non-GNU, support old
options. GNU `tar' supports them not only for historical reasons, but
also because many people are used to them. For compatibility with Unix
`tar', the first argument is always treated as containing command and
option letters even if it doesn't start with `-'. Thus, `tar c' is
equivalent to `tar -c': both of them specify the `--create' (`-c')
command to create an archive.

---------- Footnotes ----------

(1) Beware that if you precede options with a dash, you are
announcing the short option style instead of the old option style;
short options are decoded differently.
(Emphasis added)

Jetzt düften wohl alle Unklarheiten beseitigt sein...
Post Reply