Re: How to run a posgresql function/procedure thro crontab - Mailing list pgsql-admin

From Koen Martens
Subject Re: How to run a posgresql function/procedure thro crontab
Date
Msg-id 43B14E49.3090003@metro.cx
Whole thread Raw
In response to How to run a posgresql function/procedure thro crontab in Linux ES 4.0  ("Murugan G" <murugan.g@renaissance-it.com>)
List 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

pgsql-admin by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: Procedure in PostgresQL
Next
From: Michael Fuhr
Date:
Subject: Re: sending mail from Postgres