X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0CDF9D1C4D9 for ; Mon, 11 Aug 2003 03:12:40 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 39862-02 for ; Mon, 11 Aug 2003 00:11:10 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 79D6AD1C910 for ; Mon, 11 Aug 2003 00:12:26 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7B3CA106392; Sun, 10 Aug 2003 23:12:10 -0400 (EDT) From: Bruce Momjian Message-Id: <200308110312.h7B3CA106392@candle.pha.pa.us> Subject: Re: Backup routine In-Reply-To: <5777.1060443221@sss.pgh.pa.us> To: Tom Lane Date: Sun, 10 Aug 2003 23:12:10 -0400 (EDT) Cc: Enio Schutt Junior , pgsql-admin@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/138 X-Sequence-Number: 9860 Tom Lane wrote: > "Enio Schutt Junior" writes: > > Here, where I work, the backups of the postgresql databases are being done = > > the following way: > > There is a daily copy of nearly all the hd (excluding /tmp, /proc, /dev and= > > so on) in which databases are=20 > > and besides this there is also one script which makes the pg_dump of each o= > > ne of the databases on the server. > > This daily copy of the hd is made with postmaster being active (without sto= > > pping the daemon), so the data > > from /usr/local/pgsql/data would not be 100% consistent, I guess.=20 > > Supposing there was a failure and it was needed to restore the whole thing,= > > I think the procedure to > > recovery would be the following: > > 1) Copy data from the backup hd to a new hd > > 2) Once this was done, delete the postmaster.pid file and start the postmas= > > ter service > > 3) Drop all databases and recreate them from those pg_dump files > > I would just initdb and then load the pg_dump files. An unsynchronized > copy of /usr/local/pgsql/data is just about completely untrustworthy. > > You should use pg_dumpall to make a dump of user and group status; > pg_dump will not do that. > > > I was also thinking about excluding /usr/local/pgsql/data from the > > backup routine, as the data is also in other files generated by > > pg_dump. The problem is that this directory has not only the databases > > data but also some config files, like postgresql.conf. > > Yeah. Instead, exclude the directories below it ($PGDATA/base, etc). Yes, but if he restores everything but /base, he gets xlog and clog, and other stuff he shouldn't be restoring. This is why I would like the config files move into a separate directory under /data. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073