Backup - filesystem snapshots - Mailing list pgsql-admin

From Chris Jewell
Subject Backup - filesystem snapshots
Date
Msg-id 43CEA0D8.8060901@lancaster.ac.uk
Whole thread Raw
Responses Re: Backup - filesystem snapshots  (Dmitri Kushak <technical@gxs.com.au>)
Re: Backup - filesystem snapshots  (Chris Jewell <c.jewell@lancaster.ac.uk>)
List pgsql-admin
Hi,

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?

Thanks,

Chris
--
Chris Jewell
Dept of Maths and Statistics
Fylde College
Lancaster University
Lancaster
Lancs
LA1 4YF

pgsql-admin by date:

Previous
From: Jeff Frost
Date:
Subject: Re: installation problem
Next
From: "Thomas F. O'Connell"
Date:
Subject: Re: Migration from 8.0.2 to 8.1.0