Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id DBD5B475925 for ; Wed, 7 Aug 2002 12:55:41 -0400 (EDT) Received: from nuku.vosn.net (nuku.vosn.net [209.197.228.10]) by postgresql.org (Postfix) with ESMTP id 1A315475451 for ; Wed, 7 Aug 2002 12:55:41 -0400 (EDT) Received: from 181.red-80-33-59.pooles.rima-tde.net ([80.33.59.181] helo=iverdino.com) by nuku.vosn.net with asmtp (Exim 3.35 #1) id 17cU6d-0005SK-00; Wed, 07 Aug 2002 10:56:20 -0600 Message-ID: <3D5160BF.2040804@iverdino.com> Date: Wed, 07 Aug 2002 18:02:39 +0000 From: Ignacio Coloma User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020607 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Wei Weng , pgsql-sql@postgresql.org Subject: Re: running psql in a cron job References: <1028731885.30770.2.camel@Monet> <1028732473.30770.4.camel@Monet> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - nuku.vosn.net X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [0 0] X-AntiAbuse: Sender Address Domain - iverdino.com X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/134 X-Sequence-Number: 8980 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 >> >> >>