Re: How to run a posgresql function/procedure thro crontab

From: Koen Martens <pgsql(at)metro(dot)cx>
To: Murugan G <murugan(dot)g(at)renaissance-it(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: How to run a posgresql function/procedure thro crontab
Date: 2005-12-27 14:23:05
Message-ID: 43B14E49.3090003@metro.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Michael Fuhr 2005-12-27 17:41:14 Re: sending mail from Postgres
Previous Message Larry Rosenman 2005-12-27 13:57:51 Re: Procedure in PostgresQL