From: Koen Martens <pgsql@metro.cx>
To: Murugan G <murugan.g@renaissance-it.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: How to run a posgresql function/procedure thro crontab
Date: Tue, 27 Dec 2005 15:23:05 +0100
Message-ID: <43B14E49.3090003@metro.cx> (raw)
In-Reply-To: <038D31443AEF2040BC33D56D85DFD49A0118CE2D@sobha_mail.renaissance-it.com>
References: <038D31443AEF2040BC33D56D85DFD49A0118CE2D@sobha_mail.renaissance-it.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: pgsql@metro.cx, murugan.g@renaissance-it.com
Subject: Re: How to run a posgresql function/procedure thro crontab
In-Reply-To: <43B14E49.3090003@metro.cx>
References: <038D31443AEF2040BC33D56D85DFD49A0118CE2D@sobha_mail.renaissance-it.com> <43B14E49.3090003@metro.cx>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox