Re: pg_start_backup - backups

From: Ian Lea <ian(dot)lea(at)gmail(dot)com>
To: droland <david(dot)roland(at)soapware(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_start_backup - backups
Date: 2011-04-08 08:55:00
Message-ID: BANLkTik2vMyXb7EyeQLVUW8waAKDBaU4rA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> Attempting to run a backup with the database online. I first issue
> 'PG_START_BACKUP', then copy the contents of the postgresql data folder,
> then issue 'PG_STOP_BACKUP'. The database service remains running during the
> copy. If queries continue to hit the database after the PG_START_BACKUP
> command is issued changes to the data folder are possible, which can cause
> copy errors (for instance, a file not found exception). The file copy method
> first creates a string array of the data folder contents (all folders and
> files) and then processes the array, copying one file at a time. What am I
> doing wrong?

You need to use a program to do the copying that can accept changes to
files as it runs. rsync is a common choice and has the massive
advantage that it only takes changes and is therefore, after the first
run, quick.

See http://www.postgresql.org/docs/9.0/static/continuous-archiving.html#BACKUP-BASE-BACKUP
or use your favourite search engine to find more info.

--
Ian.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message French, Martin 2011-04-08 10:42:32 Re: Out Of Memory 8.1
Previous Message Scott Marlowe 2011-04-08 07:46:41 Re: Out Of Memory 8.1