Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 373561337B54 for ; Fri, 8 Apr 2011 05:55:31 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 59890-05 for ; Fri, 8 Apr 2011 08:55:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f174.google.com (mail-iw0-f174.google.com [209.85.214.174]) by mail.postgresql.org (Postfix) with ESMTP id 78F2C13364DE for ; Fri, 8 Apr 2011 05:55:20 -0300 (ADT) Received: by iwn34 with SMTP id 34so3269953iwn.19 for ; Fri, 08 Apr 2011 01:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=JVPWxg99DfAgoYmcHQZFWqwgVFSzhw3sh93JrBiNWlo=; b=htizFr9w4dNkq5qt6jaK51gwQ2rCWYG2/3pXd/xHfCFOsHdTh6Xoxd8fhrum/w1xKF AoFyEpN3UNZpll3Dtew8qxQ/omluFoShZ83D8Iq55Ioo3gp0tNPoqbOfbc/ggqkx3dQn QBLC1FwRAD23/ehjU3PYWs5mvhlU8u7nq6AYM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=HdKaS0qOiyI8p942oMQRdM20AUkibjZSwgEGhLI98F98ZT0HnNXxjsTTFSrCMsQJqE QcYyAEmna2uaw4o1eeHTLiJY0A8R6TeYlvQ3FKPcDSouftV2ndQeoJb/mabQo4m+93M/ Q6oSCm8Cgq5Kb/t0CXzn22OcixAa7Rfn+7zsE= Received: by 10.231.200.86 with SMTP id ev22mr1871778ibb.159.1302252920219; Fri, 08 Apr 2011 01:55:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.205.143 with HTTP; Fri, 8 Apr 2011 01:55:00 -0700 (PDT) In-Reply-To: <1302200280041-4289135.post@n5.nabble.com> References: <1302200280041-4289135.post@n5.nabble.com> From: Ian Lea Date: Fri, 8 Apr 2011 09:55:00 +0100 Message-ID: Subject: Re: pg_start_backup - backups To: droland Cc: pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201104/66 X-Sequence-Number: 37247 > 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.