tar cvf - | gzip -c > /dev/tape?

tar cvf - | gzip -c > /dev/tape?

Post by Roger Boo » Wed, 16 Jul 1997 04:00:00



I'm backing up 4GB of file systems to a 2GB tape.  Things were fine until
recently when I actually had more stuff on the tape.  The following
was wonderful and I was running it from my crontab:

tar cv /directories /to /backup > /tmp/tar.out

The list of backed up files ended up in /tmp/tar.out, obviously.

Now, the following would work also (actually, is equivalent)

tar cvf /dev/rmt/0 /directories /to /backup > /tmp/tar.out

But now I need to compress things, so what I want to do is:

tar cvf - /directories /to /backup | gzip -c > /dev/rmt/0

Looks good, there is one slight problem.  I need to put the
backup results in /tmp/tar.out.  I really don't want cron piping
them through my mail system, if the file names are greater than
5MB my mail system will refuse the file and possibly stop the backup.
So how do I get the results of this tar to a file.  It is fairly
obvious that once you invoke an f - with tar the results no longer
go to stdout, nor do they go to stderr.

Any suggestions? so far the only thing I have thought of is to install
gtar which has a -gzip option, but I would prefer not to have 2 tars
on my system.

TIA
Roger

If you reply to this could you please e-mail a copy to me.  I read this
group regularly but the news server I deal with is spastic and sometimes
gets no now messages for a week at a time.
----------------------------------------------------------------------
The reply-to: address in the headers is a valid address, if you want
to send me e-mail just hit reply and it should work fine.  If your
newsreader is broken and can't deal with that then send your e-mail

----------------------------------------------------------------------

 
 
 

tar cvf - | gzip -c > /dev/tape?

Post by Dave Lam » Wed, 16 Jul 1997 04:00:00


[Posted and mailed]



Quote:> I'm backing up 4GB of file systems to a 2GB tape.  Things were fine until
> recently when I actually had more stuff on the tape.  The following
> was wonderful and I was running it from my crontab:

> But now I need to compress things, so what I want to do is:

> tar cvf - /directories /to /backup | gzip -c > /dev/rmt/0

> Looks good, there is one slight problem.  I need to put the
> backup results in /tmp/tar.out.  I really don't want cron piping
> them through my mail system, if the file names are greater than
> 5MB my mail system will refuse the file and possibly stop the backup.
> So how do I get the results of this tar to a file.  It is fairly
> obvious that once you invoke an f - with tar the results no longer
> go to stdout, nor do they go to stderr.

The list goes to stderr on solaris anyway.

tar cvf - /directories /to /backup 2>/tmp/tar.out | gzip >/dev/rmt/0

works for me.
--
Dave Lampe


 
 
 

tar cvf - | gzip -c > /dev/tape?

Post by Alex Ramire » Fri, 18 Jul 1997 04:00:00


GNU tar implements a -z option which gzips the tar file in a
single step, thus:

tar -cvzf dest.file /directories /to /backup >/tmp/tar.out

should do the trick for you.

I know it sounds similar to the gtar you mentioned ... But anyway,
if you install either (GNU tar or gtar), why would you keep the old
tar, and so have 2 different ones installed ?
  Just choose the one that suits your needs and Zap the other one ...

Just my $0.02
--


> I'm backing up 4GB of file systems to a 2GB tape.  Things were fine until
> recently when I actually had more stuff on the tape.  The following
> was wonderful and I was running it from my crontab:

> tar cv /directories /to /backup > /tmp/tar.out

> But now I need to compress things, so what I want to do is:

> tar cvf - /directories /to /backup | gzip -c > /dev/rmt/0

[ but it wouldn't work ]

--
Alex Ramirez-Bellido
Computer Architecture Department
Universitat Politecnica de Catalunya

http://jedip4.upc.es/~alex

"Remember 2+2=5, for extremely large values of 2"

 
 
 

tar cvf - | gzip -c > /dev/tape?

Post by Jim Denn » Sat, 19 Jul 1997 04:00:00




        ... <much ellided> ...

Quote:> I am always hesitant to remove system provided utilities even though
> I have the GNU version installed.  It would be fine for me if I removed
> the Solaris version, but what about the next sysadmin, he may need the
> original version.
> If you are a programmer or a sysadmin you should always be concerned about
> the next person to have your job.  I could drop my motorcycly tomorrow
> and die, I try to leave things in a condition where someone else can take
> over without too much disruption of my 2K customers.
> Roger

        That's why I recommend /etc/README files for every host
        and clean archiving of all admin mail.

        If I were replacing the vendor awk and tar (highly recommended
        in most cases)!  I'd usually install the GNU version under
        /usr/local, strip the execute bits from the vendor versions,
        and add a note in /etc/README like:

        ----------------------
Fri Jul 18 17:16:49 PDT 1997 : jimd

        Installed GNU tar and awk from Apr '96 CD in /usr/local/bin
        Stripped x bits on /usr/bin copies.
        ----------------------

        That's all there is to it.  Any change to system files,
        configurations, etc are documented this way.  Just enough
        details are supplied that a reasonably competant SA should
        understand them and be able to follow the file, step by
        step, on a new installation and have a reasonably close
        approximation of your system by the time their done.

        This is also WAY valuable when you forget what you did!
--


Starshine Technical Services              http://www.starshine.org


        Key fingerprint =  2524E3FEF0922A84  A27BDEDB38EBB95A

 
 
 

tar cvf - | gzip -c > /dev/tape?

Post by Roger Boo » Sat, 19 Jul 1997 04:00:00



> GNU tar implements a -z option which gzips the tar file in a
> single step, thus:

> tar -cvzf dest.file /directories /to /backup >/tmp/tar.out

> should do the trick for you.

Several helpful people e-mailed me how to deal with what I want to
do, basicly it is:

tar cvf - /dir /to /backup 2> /tmp/tar/out | gzip -c > /dev/rmt/0

Quote:

> I know it sounds similar to the gtar you mentioned ... But anyway,
> if you install either (GNU tar or gtar), why would you keep the old
> tar, and so have 2 different ones installed ?

I am always hesitant to remove system provided utilities even though
I have the GNU version installed.  It would be fine for me if I removed
the Solaris version, but what about the next sysadmin, he may need the
original version.

If you are a programmer or a sysadmin you should always be concerned about
the next person to have your job.  I could drop my motorcycly tomorrow
and die, I try to leave things in a condition where someone else can take
over without too much disruption of my 2K customers.

Roger
----------------------------------------------------------------------
The reply-to: address in the headers is a valid address, if you want
to send me e-mail just hit reply and it should work fine.  If your
newsreader is broken and can't deal with that then send your e-mail

----------------------------------------------------------------------

 
 
 

1. tar -cvf /dev/rmt/0 / > /tmp/tar.out

Hi all,

I have a question.  I am trying to backup the entire system using the
command

% tar -cvf /dev/rmt/0 / > /tmp/tar.out

and i get a never ending process and when I do a tail on the file, I get

//dev/fd/0    or something like that

many times.  I have a Sparc 1000 running solaris 2.5 with only a cdrom.
There are no floppy drives attached to it.  Can anyone tell me why this
is so and how to avoid this.  I have not experimented with ufsdump and
am not sure if it supports restoring individual files.

P.S. I would prefer e-mail since I dont get a chance to read this
newsgroup very often.

Thanks,
--
Shahab Raza Khan              George Mason University

After a number of decimal places, nobody gives a damn.

2. Solaris won't use the 2nd DNS Ip Address if the 1st fails.

3. Which is better: tar->gzip or gzip->tar?

4. shared memory and cpu statistics

5. pcmcia with RH 5.2

6. Problem: tar cvf user@server:/dev/ftape : readonly file system

7. Verify password from command line

8. "tar cvf /dev/fd0 files..." scrambles hard drive!

9. HELP: 2>&1 > /dev/null != 2>&- > /dev/null ???

10. SCSI tape & tar >>>

11. tar -cvf - | (cd dir; tar -xpvf - ) with changing access time?