Cron and shell script as user postgres to run sql command

Поиск
Список
Период
Сортировка
От Josep Sànchez Mesegué
Тема Cron and shell script as user postgres to run sql command
Дата
Msg-id e74c0cea0805261418y6b01cfach45668c8fc12e126e@mail.gmail.com
обсуждение исходный текст
Ответы Re: Cron and shell script as user postgres to run sql command
Список pgsql-novice
Hi,

I've been trying to run a shell script that, among other things, invokes
some sql scripts as user postgres with cron. First, I found that as cron
doesn't inherit the environment variables that are defined in the
script, i.e. the path to some of the scripts, I had to declare them
globally. But when I've done this, it seems that cron is not able to run
this script as postgres user. (all of this under Debian Etch)
In every forum or webpage where I look at, it seems that it has to be
run as root to work....but how can it work running it as root if the
user to run the sql scripts and access the database has to be
postgres??

What am I missing?

Thanks in advance for your help.


--
Josep Sànchez
[papapep]
-------------------------------------------------
http://extralinux.net
-------------------------------------------------

В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Unable to recover tables
Следующее
От: "Phillip Smith"
Дата:
Сообщение: Re: Cron and shell script as user postgres to run sql command