Thread: Cron and shell script as user postgres to run sql command

Cron and shell script as user postgres to run sql command

From
"Josep Sànchez Mesegué"
Date:
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
-------------------------------------------------

Re: Cron and shell script as user postgres to run sql command

From
"Phillip Smith"
Date:
> But when I've done this, it seems that cron is not able to run
> this script as postgres user.

Do you have any error messages or logs to show and detail this?


THINK BEFORE YOU PRINT - Save paper if you don't really need to print this

*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to
the addressee.  If you are not the addressee indicated in this message or
responsible for delivery of the message to such person, you may not copy
or deliver this message to anyone, and you should destroy it and kindly
notify the sender by reply email.

Information in this message that does not relate to the official business
of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.
Weatherbeeta, its employees, contractors or associates shall not be liable
for direct, indirect or consequential loss arising from transmission of this
message or any attachments
e-mail.