Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > Cron and shell ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 3125 of 3323
Post > Topic >>

Cron and shell script as user postgres to run sql command

by papapep@[EMAIL PROTECTED] ("=?ISO-8859-1?Q?Josep_S=E0nchez_Mesegu=E9?=") May 26, 2008 at 11:18 PM

------=_Part_19306_19457845.1211836701968
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

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.


--=20
Josep S=E0nchez
[papapep]
-------------------------------------------------
http://extralinux.net
-------------------------------------------------

------=_Part_19306_19457845.1211836701968
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi,<br><br>I&#39;ve been trying to run a shell script that, among other
thi=
ngs, invokes<br>some sql scripts as user postgres with cron. First, I
found=
 that as cron<br>doesn&#39;t inherit the environment variables that are
def=
ined in the<br>
script, i.e. the path to some of the scripts, I had to declare
them<br>glob=
ally. But when I&#39;ve done this, it seems that cron is not able to
run<br=
>this script as postgres user. (all of this under Debian Etch)<br>In every
=
forum or webpage where I look at, it seems that it has to be<br>
run as root to work....but how can it work running it as root if
the<br>use=
r to run the sql scripts and access the database has to
be<br>postgres??<br=
><br>What am I missing?<br><br>Thanks in advance for your help.<br><br
clea=
r=3D"all">
<br>-- <br>Josep
S=E0nchez<br>[papapep]<br>--------------------------------=
-----------------<br><a
href=3D"http://extralinux.net">http://extralinux.ne=
t</a><br>-------------------------------------------------

------=_Part_19306_19457845.1211836701968--
 




 2 Posts in Topic:
Cron and shell script as user postgres to run sql command
papapep@[EMAIL PROTECTED]  2008-05-26 23:18:21 
Re: Cron and shell script as user postgres to run sql command
phillip.smith@[EMAIL PROT  2008-05-27 10:17:55 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 5:38:22 CST 2008.