From owner-freebsd-questions@FreeBSD.ORG Wed Oct 13 21:20:22 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BEDBE16A4CE for ; Wed, 13 Oct 2004 21:20:22 +0000 (GMT) Received: from mail.indatacorp.com (65.104.0.66.ptr.us.xo.net [65.104.0.66]) by mx1.FreeBSD.org (Postfix) with SMTP id 2119643D46 for ; Wed, 13 Oct 2004 21:20:21 +0000 (GMT) (envelope-from rgrafton@indatacorp.com) Received: (qmail 51805 invoked by uid 0); 13 Oct 2004 21:26:30 -0000 Received: from unknown (HELO ?192.168.100.179?) (rgrafton@indatacorp.com@192.168.100.179) by netfb01.indatacorp.com with SMTP; 13 Oct 2004 21:26:30 -0000 Message-ID: <416D9C1D.1000104@indatacorp.com> Date: Wed, 13 Oct 2004 14:20:29 -0700 From: Randy Grafton User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dick Davies References: <416D4546.9090308@webminded.nl> <20041013204735.GO9309@lb.tenfour> In-Reply-To: <20041013204735.GO9309@lb.tenfour> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: Norman Uittenbogaart cc: FreeBSD Questions Subject: Re: Postgres X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2004 21:20:22 -0000 Dick Davies wrote: >* Norman Uittenbogaart [1010 16:10]: > > >>I'm trying to write a backup script for postgres and us a crontab on it. >>In the manual it says for pg_dumpall make $HOME/.pgpass so it won't ask >>for a password. >>Now I made the .pgpass in root's homedir (i wanted to use root's >>crontab) paste the password in it, chmod 400 it ... >> >> > >Can't you just pgdump from the local socket? And not bother with the password >thing at all? > > > > I chose to go with the pg_dump solution command from root's crontab. Cron runs a script once a night with the following commands: DATE=`/bin/date +%Y%m%d` /usr/local/bin/vacuumdb -a -F -v -U pgsql > /var/backups/"$DATE"_pg.vac /usr/local/bin/pg_dump -Fc -U pgsql db_name > /var/backups/"$DATE"_db.bu -Randy