X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0F9BF9DC80C for ; Tue, 27 Dec 2005 10:22:46 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 11687-02 for ; Tue, 27 Dec 2005 10:22:49 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id E80D79DC81D for ; Tue, 27 Dec 2005 10:22:43 -0400 (AST) Received: from mx1.sonologic.nl (mx1.sonologic.nl [82.94.245.21]) by svr4.postgresql.org (Postfix) with ESMTP id A22885AF91D for ; Tue, 27 Dec 2005 14:22:48 +0000 (GMT) Received: from [127.0.0.1] (mx1.sonologic.nl [82.94.245.21]) (authenticated bits=0) by mx1.sonologic.nl (8.13.3/8.13.3) with ESMTP id jBREMfCm003180; Tue, 27 Dec 2005 14:22:44 GMT Message-ID: <43B14E49.3090003@metro.cx> Date: Tue, 27 Dec 2005 15:23:05 +0100 From: Koen Martens Organization: Sonologic User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Murugan G Cc: pgsql-admin@postgresql.org Subject: Re: How to run a posgresql function/procedure thro crontab References: <038D31443AEF2040BC33D56D85DFD49A0118CE2D@sobha_mail.renaissance-it.com> In-Reply-To: <038D31443AEF2040BC33D56D85DFD49A0118CE2D@sobha_mail.renaissance-it.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Helo-Milter-Authen: gmc@sonologic.nl, pgsql@metro.cx, mx1 Received-SPF: pass (mx1.sonologic.nl: 82.94.245.21 is authenticated by a trusted mechanism) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/322 X-Sequence-Number: 20042 Murugan G wrote: > Hello, > If anybody tried, please let me know how to run a postgresQL > function/procedure thro crontab in Linux ES 4.0 > > $ psql --help This is psql 8.1.0, the PostgreSQL interactive terminal. ...... -c COMMAND run only single command (SQL or internal) and exit ...... So just put a proper invocation of psql in cron, eg something like: 0 * * * * /path/to/binary/psql -U foo -h yourhost.com -c "select bar()" dbname 1> /dev/null Gr, Koen