Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id AF8B69F9FD3 for ; Tue, 21 Aug 2007 18:44:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 10656-01 for ; Tue, 21 Aug 2007 18:44:34 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.186]) by postgresql.org (Postfix) with ESMTP id 896DB9F9FDE for ; Tue, 21 Aug 2007 18:44:34 -0300 (ADT) Received: by rv-out-0910.google.com with SMTP id l15so1261340rvb for ; Tue, 21 Aug 2007 14:44:28 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=tHA+u0gJ7FROddPwpxoWrIHl2ZGhiKXpmWJ44cfe1DcoF6t/i/gfkw1m7r3qNLnc2NGIW82fk2ZYeI2qKcL8hYcc6iW07CuojauR74g9rbNEfjQSEp8xB6Rxxfq3Joub8gsKYKREq0nQq6rqNbR1YpPNk/R3+LK8a0ojyx1gap8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=LU6WJXGPKC4j5/4UI3lYZApiDNpVcMKIyMbejcJXRvXWR3zsVpQGCAQYzvtLdACJjNyFV47ms4e38xXYCV7YcMOSQxQ5nGYcn2kD4NO0i15jZIIBw6Plrye2OwdMhBWA+m0N61x2KEHQTtTRXRhL++fdrBQpO2c4M4Jb9PN0awo= Received: by 10.140.139.3 with SMTP id m3mr3669359rvd.1187732667868; Tue, 21 Aug 2007 14:44:27 -0700 (PDT) Received: by 10.141.98.12 with HTTP; Tue, 21 Aug 2007 14:44:27 -0700 (PDT) Message-ID: Date: Tue, 21 Aug 2007 16:44:27 -0500 From: "Scott Marlowe" To: "Bolotov Pavel" Subject: Re: vacuum and database backup Cc: pgsql-admin@postgresql.org In-Reply-To: <978733.49771.qm@web33502.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <978733.49771.qm@web33502.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/264 X-Sequence-Number: 26595 On 8/21/07, Bolotov Pavel wrote: > Hi > > How can i setup vacuum and database backup > from crontab on ubuntu. > The problem is that both programs ask password. > > Could you send an example script. All you need is a .pgpass file for the account running the backups. (or trust for that account or identd if it's on the same machine) Using .pgpass with a line like this: dbmachinename:5432:dbname:postgres:password in say, the postgres user's home directory, and set to 0600 permissions, pg_dump could backup the db named dbname on the machine dbmachinename as the user postgres with the password password. All that's left is cronning it up. You might have to set a home dir in crontab at the top: HOME=/home/postgres