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 18257D1C4C8 for ; Sat, 9 Aug 2003 15:34:10 +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 80940-01 for ; Sat, 9 Aug 2003 12:32:39 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 1D8F4D1C9D5 for ; Sat, 9 Aug 2003 12:33:59 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h79FXfSa005778; Sat, 9 Aug 2003 11:33:41 -0400 (EDT) To: "Enio Schutt Junior" Cc: pgsql-admin@postgresql.org Subject: Re: Backup routine In-reply-to: <000c01c35dd6$d62b43d0$e205000a@compaq> References: <000c01c35dd6$d62b43d0$e205000a@compaq> Comments: In-reply-to "Enio Schutt Junior" message dated "Fri, 08 Aug 2003 14:59:39 -0300" Date: Sat, 09 Aug 2003 11:33:41 -0400 Message-ID: <5777.1060443221@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/129 X-Sequence-Number: 9851 "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). regards, tom lane