X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E8CC09DC83F for ; Wed, 18 Jan 2006 18:31:30 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 22564-05 for ; Wed, 18 Jan 2006 18:31:31 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by postgresql.org (Postfix) with ESMTP id AADB09DC820 for ; Wed, 18 Jan 2006 18:31:27 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.13.1/8.13.1) with ESMTP id k0IMVQuQ008088 for ; Wed, 18 Jan 2006 22:31:26 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.13.1/8.13.1/Submit) id k0IM3xFY095385 for pgsql-admin@postgresql.org; Wed, 18 Jan 2006 18:03:59 -0400 (AST) (envelope-from news) From: Chris Browne X-Newsgroups: pgsql.admin Subject: Re: Backup - filesystem snapshots Date: Wed, 18 Jan 2006 17:00:40 -0500 Organization: cbbrowne Computing Inc Lines: 31 Message-ID: <60fynlnqlz.fsf@dba2.int.libertyrms.com> References: <43CEA0D8.8060901@lancaster.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.18 (linux) Cancel-Lock: sha1:9WWoupubGmPxyWZKdf1j6ChSTDw= To: pgsql-admin@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=-1.255 required=5 tests=[ALL_TRUSTED=-1.44, AWL=0.185] X-Spam-Score: -1.255 X-Spam-Level: X-Archive-Number: 200601/201 X-Sequence-Number: 20289 c.jewell@lancaster.ac.uk (Chris Jewell) writes: > I'm trying to implement a backup strategy for a research database in > order to prevent again users accidentally dropping their data. > > My preferred method would be to create regular snapshots of the data > directory, and then send this to the backup server using rsync, with > hard-linking backup rotation. The backup data directories could then be > examined using a postmaster running on the backup server to extract any > accidentally deleted tables. > > My problem is how to do these snapshots: is it enough to create a hard > link to the directory, or is there still a risk that a currently running > transaction might introduce inconsistencies? I guess I could use the > pg_ctl -m 'Smart' command to stop the database after all clients have > disconnected, but I sometimes have users leaving their clients connected > all night. Is there any other way to suspend the postmaster such that > it finishes its current transaction and queues any other transactions > while the snapshot is taking place? Any other ideas of how I can create > such snapshots? Short answer to "is there a risk?" is "You betcha!" There's a fairly new feature called Point in Time Recovery that is specifically designed to address those risks. -- let name="cbbrowne" and tld="ntlug.org" in String.concat "@" [name;tld];; http://cbbrowne.com/info/advocacy.html The English exam was a piece of cake---which was a bit of a surprise, actually, because I was expecting some questions on a sheet of paper.