logo       

Re: Rodar function no cron: msg#00575

db.postgresql.brasil

Subject: Re: Rodar function no cron

On Tue, Mar 25, 2003 at 02:05:35PM +0000, Edaiana Oliveira
<edaiana-/E1597aS9LRfJ/NunPodnw@xxxxxxxxxxxxxxxx> wrote:
> Pessoal tenho a função alimenta_cidade_afiliada()
> como faço pra ela rodar no cron do linux às 03:00hs?

roberto@brasileiro:~$ psql --help
This is psql, the PostgreSQL interactive terminal.

Usage:
psql [options] [dbname [username]]

Options:
...
-c COMMAND Run only single command (SQL or internal) and exit
...


Então chame o "psql -c 'SELECT alimenta_cidade_afiliada()'" de dentro do
crontab do usuário com permissões para acesso ao banco.

-Roberto

--
+----| Roberto Mello - http://www.brasileiro.net/ |------+
+ Computer Science Graduate Student, Utah State University +
+ USU Free Software & GNU/Linux Club - http://fslc.usu.edu/ +
panic("Foooooooood fight!");
-- In the kernel source aha1542.c, after detecting a bad segment list

----------------------------------------------------------
Grupo PostgreSQL Brasil. Fundado em 1999.
Mensagens para: postgresql-br-EYaqaC9dFX8MqA7zqLjoiV/I71DsQ//L@xxxxxxxxxxxxxxxx
Desassociação:
postgresql-br-unsubscribe-EYaqaC9dFX8MqA7zqLjoiV/I71DsQ//L@xxxxxxxxxxxxxxxx
Site Web: http://br.groups.yahoo.com/group/postgresql-br


Seu uso do Yahoo! Grupos é sujeito às regras descritas em:
http://br.yahoo.com/info/utos.html





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise