X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 508F33A55AA for ; Mon, 24 Jan 2005 17:09:31 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 65057-08 for ; Mon, 24 Jan 2005 17:09:27 +0000 (GMT) Received: from koolancexeon.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by svr1.postgresql.org (Postfix) with ESMTP id A70633A55A0 for ; Mon, 24 Jan 2005 17:09:26 +0000 (GMT) Received: mail.g2switchworks.com 10.10.1.8 from 10.10.1.37 10.10.1.37 via HTTP with MS-WebStorage 6.5.6944 Received: from state.g2switchworks.com by mail.g2switchworks.com; 24 Jan 2005 11:09:25 -0600 Subject: Re: Postgres 8.0 Backups From: Scott Marlowe To: Pallav Kalva Cc: pgsql-admin@postgresql.org In-Reply-To: <41F52694.1090309@deg.cc> References: <41F52694.1090309@deg.cc> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1106586565.16640.90.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Mon, 24 Jan 2005 11:09:25 -0600 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/248 X-Sequence-Number: 16107 On Mon, 2005-01-24 at 10:47, Pallav Kalva wrote: > Hi Everybody, > > I am working on a backup script for Postgres 8.0 online backups and > since i have to copy the whole pgdata directory , i am wondering after i > copy the pgdata directory can I run gzip or tar on the data directory ? > is it safe to do gzip or tar and I can safely restore the backups later ? Yes, however, you may have some issues to deal with. Generally speaking, file system level backups are not the best way to backup postgresql, since they require either shutting down the server or using a snapshot file system to get a coherent backup. File system backups taken by normal copy / tar during database operation may result in backups that don't work when you need them to. pg_dump is generally the better way to back things up, and with the right switches will create a Z compressed tar file automagically for you.