Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3E3E2475992 for ; Wed, 7 Aug 2002 13:07:50 -0400 (EDT) Received: from mta5.snet.net (mta5.snet.net [204.60.203.77]) by postgresql.org (Postfix) with ESMTP id 9AE07475925 for ; Wed, 7 Aug 2002 13:07:49 -0400 (EDT) Received: from pop.snet.net ([204.60.203.73]) by mta5.snet.net (8.12.3/8.12.3/SNET-mx-1.2/D-1.1.1.1/O-1.1.1.1) with ESMTP id g77H4ut0013099 for ; Wed, 7 Aug 2002 13:04:56 -0400 (EDT) X-Originating-IP: [64.252.95.167] X-SBCIS-MTA: [pop.snet.net] Received: from [192.168.1.83] (167.95.252.64.snet.net [64.252.95.167]) by pop.snet.net (8.12.3/8.12.3/SNET-pop-1.2/D-1.1.1.1/O-1.1.1.1) with ESMTP id g77H7jT0016105 for ; Wed, 7 Aug 2002 13:07:46 -0400 (EDT) Subject: Re: running psql in a cron job From: Wei Weng To: pgsql-sql@postgresql.org In-Reply-To: <3D5160BF.2040804@iverdino.com> References: <1028731885.30770.2.camel@Monet> <1028732473.30770.4.camel@Monet> <3D5160BF.2040804@iverdino.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 07 Aug 2002 13:07:47 -0400 Message-Id: <1028740068.31451.0.camel@Monet> Mime-Version: 1.0 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/135 X-Sequence-Number: 8981 PGPASSWORD=my_pass sets the password to my_pass. On Wed, 2002-08-07 at 14:02, 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 > > 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 > > > > > >On Wed, 2002-08-07 at 10:51, Wei Weng wrote: > > > > > >>My database has "local all password" as its HBA control. > >> > >>Is there anyway to manipulate psql so that I can somehow put the > >>password also inside the command line so that I can run psql in a cron > >>job? (such as psql -c "VACUUM ANALYZE" -d my_data -U my_user) > >> > >>Thanks > >> > >>-- > >>Wei Weng > >>Network Software Engineer > >>KenCast Inc. > >> > >> > >> > >>---------------------------(end of broadcast)--------------------------- > >>TIP 6: Have you searched our list archives? > >> > >>http://archives.postgresql.org > >> > >> > >> > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > -- Wei Weng Network Software Engineer KenCast Inc.