Discussion:
tar: how does it work?
Vittorio
2005-10-21 08:25:20 UTC
Permalink
In a script under freebsd I issued the following tar command
successfully while under netbsd it fails saying

uffBSD# /bin/tar -cz
/etc > /pgdump/etc.5.tar.gz
tar: Failed open to write on /dev/nrst0
(Device not configured)
tar: Unexpected EOF on archive file

I tried
(under netbsd) the following but:

uffBSD# /bin/tar -cz /pgdump/etc.5.
tar.gz /etc
tar: Failed open to write on /dev/nrst0 (Device not
configured)
tar: Unexpected EOF on archive file

Besides issuing

uffBSD# /bin/tar -cfz /pgdump/etc.5.tar.gz /etc/*
tar: Removing leading
/ from absolute path names in the archive

But there's NOTHING inside
etc.t.tar.gz.

Could you please help me?

Vittorio
Matthias Buelow
2005-10-21 08:36:23 UTC
Permalink
Post by Vittorio
In a script under freebsd I issued the following tar command
successfully while under netbsd it fails saying
Use the -f argument for specifying an archive file (or - for
stdin/stdout), see "man tar". If you don't specify a file, then tar will
try to read from a tape device (/dev/nrst0).

Alternatively, use the pax command (see "man pax"), which acts as a
filter by default but uses different command syntax from tar.

mkb.
Ralf Doering
2005-10-21 10:15:07 UTC
Permalink
Post by Vittorio
In a script under freebsd I issued the following tar command
successfully while under netbsd it fails saying
uffBSD# /bin/tar -cz
/etc > /pgdump/etc.5.tar.gz
tar: Failed open to write on /dev/nrst0
[...]

You have to use the -f switch, as you found out yourself already. But
this can be a little bit annoying, as you found out too ;)
Post by Vittorio
uffBSD# /bin/tar -cfz /pgdump/etc.5.tar.gz /etc/*
tar: Removing leading
/ from absolute path names in the archive
But there's NOTHING inside
etc.t.tar.gz.
Order os parameters is essential in this case. Please try

/bin/tar czf /pgdump/etc.5.tar.gz /etc/*

This should work.

Ralf

Loading...