Обсуждение: How to run a posgresql function/procedure thro crontab in Linux ES 4.0

Поиск
Список
Период
Сортировка

How to run a posgresql function/procedure thro crontab in Linux ES 4.0

От
"Murugan G"
Дата:

Hello,
If anybody tried, please let me know how to run a postgresQL function/procedure thro crontab in Linux ES 4.0

Thanks and regards,
G.Murugan,
Sr. Software Engineer.

Extn. 1658
===========================================================================
Sobha Renaissance Information Technology Private Limited
An SEI-CMM & P-CMM Level 5 Company
World's 1st SSE-CMM Level 5 Company
BS 7799 certified by British Standards Institute
ISO 9001:2000 Certified by TÜV Rheinland/Berlin-Brandenburg
A Six Sigma Practice Company
Tel: + 91 80 51951999; Fax: + 91 80 51523300; Video Conference: + 91 80 51252222
Email : murugan.g
@renaissance-it.com; Web: www.renaissance-it.com
===========================================================================
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete all copies from any computer.

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

От
Koen Martens
Дата:
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