[TriLUG] Using gzip to backup postgres to tape
Len Boyle
Len.Boyle at sas.com
Mon Nov 27 22:00:42 EST 2006
I do not think that it is the format per say. The problem is that the final program has to know how to issues tape i/o commands, which are different then disk i/o commands.
If you have the blocks of data you can run them thru the dd command which knows how to write to disk or tape.
-----Original Message-----
From: trilug-bounces at trilug.org [mailto:trilug-bounces at trilug.org] On Behalf Of Andrew Perrin
Sent: Monday, November 27, 2006 9:46 PM
To: Triangle Linux Users Group discussion list
Subject: Re: [TriLUG] Using gzip to backup postgres to tape
On Mon, 27 Nov 2006, Brian Henning wrote:
> o A gzipped tar isn't tar format; it's gzip format. The tape drive doesn't
> know what to do with gzip and chokes.
I agree with this empirically, but it doesn't make sense to me, since tar
-zf /dev/nst0 works, and man tar says:
-z, --gzip, --gunzip, --ungzip
filter the archive through gzip
so it seems like there ought to be a way to make gzip spit out gzipped tar
data that will write to the tape. But nevertheless...
> ... script the
> following steps:
>
> 1) Dump from postgre through gzip into a file. Don't worry about tar format;
> dump it however postgre likes it when it's time to restore.
>
> pg_dump --make-restore-easier mydatabase | gzip [-9] tempdump.gz
>
> (where --make-restore-easier is whatever set of flags and options makes
> restoration easiest, and [-9] means optionally specify maximum gzip
> compression)
>
> 2) Tar the gzipped file onto the tape drive
>
> tar -cvf /dev/nst0 tempdump.gz
>
> 3) Delete the temporary file
>
> rm tempdump.gz
This is a clever approach, and I'll try it tomorrow. Thanks - kludgy, but
clever.
Andy
----------------------------------------------------------------------
Andrew J Perrin - andrew_perrin (at) unc.edu - http://perrin.socsci.unc.edu
Assistant Professor of Sociology; Book Review Editor, _Social Forces_
University of North Carolina - CB#3210, Chapel Hill, NC 27599-3210 USA
New Book: http://www.press.uchicago.edu/cgi-bin/hfs.cgi/00/178592.ctl
--
TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
TriLUG Organizational FAQ : http://trilug.org/faq/
TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
More information about the TriLUG
mailing list