We need to be careful as to what we mean by "data directory".  A
typical PostgreSQL installation has a directory *named* "data" which
*should* be backed up.  It contains configuration and access-control
data, perhaps X.509 certificates to enable TLS-encrypted access, some
small files used for restarting, and several directories that hold
transaction logs and the like.

Also (typically) inside the "data" directory is the "base" directory
which contains the actual table backing-store.  There is no point in
doing a file-wise backup of the "base" directory or any of its
dependents.  There is a significant probability that such a snapshot
would result in an inconsistent database should it be restored.  The
proper way to back up this information is through pg_dump or
pg_dumpall.

What I usually do is to have a cron job run pg_dumpall and direct the
output to a file such as 'db.tar.gz' somewhere associated with
PostgreSQL.  On a Gentoo Linux system, that would be
/var/lib/postgresql (which contains the "data" directory).  Then the
regular file-wise tape backup will capture a consistent dump of the
tables.

I don't yet know whether it is useful to back up all of the other
subdirectories of "data", but we do that.  pg_log contains message
logs and would be useful.

Some system backup products may offer agents that can consistently back
up PostgreSQL database clusters.  We use DataProtector and, alas, it
doesn't have such an agent.  If you *do* have such an agent available,
that's probably a better approach than mine.

-- 
Mark H. Wood, Lead System Programmer   [EMAIL PROTECTED]
Typically when a software vendor says that a product is "intuitive" he
means the exact opposite.

Attachment: pgpFy4Qr0TsyD.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to