Re: tarfile backup question

by "Steve Mount" <steve(at)saltyrain.com>

 Date:  Mon, 8 Apr 2002 11:24:14 -0400
 To:  "John Rand" <johnrand(at)owlseye.net>,
<hwg-servers(at)hwg.org>
 References:  beta
  todo: View Thread, Original
tar files are just one file with many files inside - to keep track of the
files, there has to be extra info about each directory and file, so the
total file size of the tar file will probably be larger than the sum total
of the files.  However, any space you give up to the disk in terms of block
size is recovered (e.g., a 1K file might actually take up 8K of disk, but
only takes up 1K in the tar file).

To compress your tar file, just compress it with, presumably, gzip:

gzip -9 backup.tar

The -9 uses maximum compression.  However, unless you're storing other
things on your second hard drive, the compression seems like overkill.  You
can pipe the output of tar to gzip, but my preference is to do it in steps.
But here's the code anyway:

tar c /disk1 | gzip -9 >/disk2/backup.tar.gz


-------------------------------------------------------------
Steve Mount, Software Engineer            steve(at)saltyrain.com
Home Site                            http://www.saltyrain.com
US Constitution Online          http://www.usconstitution.net

----- Original Message -----
From: "John Rand" <johnrand(at)owlseye.net>
To: <hwg-servers(at)hwg.org>
Sent: Friday, April 05, 2002 6:24 PM
Subject: tarfile backup question


> Maybe someone can answer a question for a relative newbie.
>
> I have a Linux machine with dual 18gb hard drives.  I
> back up one drive onto another every night.  I create
> a tar file, which seems to be bigger than what is being
> backed up.  I've tried tar.gz, and it doesn't seem to be
> much better.
>
> Is there a better way to create a compressed backup file?
>
>

HWG: hwg-servers mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.