Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id AA554475917 for ; Wed, 7 Aug 2002 14:54:10 -0400 (EDT) Received: from ece.rice.edu (ece.rice.edu [128.42.4.34]) by postgresql.org (Postfix) with ESMTP id 4CD8D47580E for ; Wed, 7 Aug 2002 14:54:10 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by ece.rice.edu (Postfix) with ESMTP id 9687668A69; Wed, 7 Aug 2002 13:54:10 -0500 (CDT) Received: from wallace.ece.rice.edu (wallace.ece.rice.edu [128.42.12.154]) by ece.rice.edu (Postfix) with ESMTP id D0F4C68A6F; Wed, 7 Aug 2002 13:54:09 -0500 (CDT) Received: from reedstrm by wallace.ece.rice.edu with local (Exim 3.34 #1 (Debian)) id 17cVwf-0002ZY-00; Wed, 07 Aug 2002 13:54:09 -0500 Date: Wed, 7 Aug 2002 13:54:09 -0500 From: "Ross J. Reedstrom" To: Ignacio Coloma Cc: Wei Weng , pgsql-sql@postgresql.org Subject: Re: running psql in a cron job Message-ID: <20020807185409.GB9661@rice.edu> Mail-Followup-To: "Ross J. Reedstrom" , Ignacio Coloma , Wei Weng , pgsql-sql@postgresql.org References: <1028731885.30770.2.camel@Monet> <1028732473.30770.4.camel@Monet> <3D5160BF.2040804@iverdino.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D5160BF.2040804@iverdino.com> User-Agent: Mutt/1.3.27i X-Virus-Scanned: by AMaViS snapshot-20020300 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/137 X-Sequence-Number: 8983 On Wed, Aug 07, 2002 at 06:02:39PM +0000, Ignacio Coloma wrote: > Maybe I'm a bit lost: if cron is executed as root, then su -c > 'command' would work without providing the password? > > I mean, putting the password plain text anywhere doesn't seem that nice > idea imho It's not the unix 'postgres' user's password: it's the database password for the DB user - a completely independent user/password pair. Ross > > Wei Weng wrote: > > >never mind. a quick search in the mailing list archive solved the > >problem. :) > > > >Just use PGPASSWORD=my_pass psql -c "VACUUM ANALYZE" -d my_data -U > >my_user