<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: [postgis-users] Cron / shp2psql</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Something can't find the actually directory where your database itself is (the directory that has the pg_hba.conf file and so on).<BR>
<BR>
How you set a ENV var depends on the type of shell you are using.<BR>
<BR>
In a cshell for instance:<BR>
#!/usr/bin/csh<BR>
#<BR>
setenv PGDATA /data/postgres/mydb<BR>
<...><BR>
<BR>
In a kshell:<BR>
#!/bin/bash<BR>
<BR>
export PGDATA=/data/pgsql/bronze<BR>
<...><BR>
<BR>
The error message is a bit confusing because the only programs I can find with -D being a directory are the pg_ctl process (which starts and stops the database engine and hopefully is not relevant here), postmaster and postgres (a stand alone backend that hopefully is not involved here either). I suspect that the psql process is invoking the postmaster which is then confused by not knowing where to look for the root of the data directories.<BR>
<BR>
Greg W.<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: postgis-users-bounces@postgis.refractions.net on behalf of chris brisendine<BR>
Sent: Sun 6/1/2008 4:11 PM<BR>
To: PostGIS Users Discussion<BR>
Subject: Re: [postgis-users] Cron / shp2psql<BR>
<BR>
my mail log is giving me this"<BR>
postgres does not know where to find the server configuration file.<BR>
You must specify the --config-file or -D invocation option or set the<BR>
PGDATA environment variable.<BR>
how would i add the path or the variable.<BR>
<BR>
<BR>
On Sun, Jun 1, 2008 at 5:53 PM, Gregory Williamson<BR>
<Gregory.Williamson@digitalglobe.com> wrote:<BR>
> In the cron job you may not have the environment (in particular PATH) set;<BR>
> try adding an explicit paths to all file and executable references. ?<BR>
><BR>
> HTH,<BR>
><BR>
> Greg Williamson<BR>
> Senior DBA<BR>
> DigitalGlobe<BR>
><BR>
> Confidentiality Notice: This e-mail message, including any attachments, is<BR>
> for the sole use of the intended recipient(s) and may contain confidential<BR>
> and privileged information and must be protected in accordance with those<BR>
> provisions. Any unauthorized review, use, disclosure or distribution is<BR>
> prohibited. If you are not the intended recipient, please contact the sender<BR>
> by reply e-mail and destroy all copies of the original message.<BR>
><BR>
> (My corporate masters made me say this.)<BR>
><BR>
><BR>
><BR>
> -----Original Message-----<BR>
> From: postgis-users-bounces@postgis.refractions.net on behalf of Dan<BR>
> Blomberg<BR>
> Sent: Sun 6/1/2008 3:20 PM<BR>
> To: PostGIS Users Discussion<BR>
> Subject: Re: [postgis-users] Cron / shp2psql<BR>
><BR>
> On this note, I thought I had fixed my problem but it doesn't work<BR>
> either.  I can even run it as a bat but I can't call the bat in visual<BR>
> basic or just run the command that is in the bat file.<BR>
><BR>
> chris brisendine wrote:<BR>
>> I have cron running a shell script "<BR>
>> shp2pgsql -d -s 4326 /home/storm/ww/TOR.shp torpoly wxsvr>torpoly.sql<BR>
>> sleep 7<BR>
>> shp2pgsql -d -s 4326 /home/storm/ww/SVR.shp svrpoly wxsvr| psql -d  wxsvr<BR>
>> echo `date`>updated.txt<BR>
>> "<BR>
>> When i run this from the command line it works flawless but when cron<BR>
>> runs it it dosent update my nwswarnings! Any idea's?<BR>
>> I know the new warnings are being downloaded and the the script is<BR>
>> running cause it writes to the updated.txt file when it runs.<BR>
>> I have tryed it two different ways but no luck...<BR>
>><BR>
> _______________________________________________<BR>
> postgis-users mailing list<BR>
> postgis-users@postgis.refractions.net<BR>
> <A HREF="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR>
><BR>
><BR>
> _______________________________________________<BR>
> postgis-users mailing list<BR>
> postgis-users@postgis.refractions.net<BR>
> <A HREF="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR>
><BR>
><BR>
<BR>
<BR>
<BR>
--<BR>
Thanks,<BR>
Chris Brisendine<BR>
Henry Co. EMA - Operations and Information Systems.<BR>
Home: 731.642.7103<BR>
Cell: 731.363.3430<BR>
Email: ki4gyw@gmail.com<BR>
_______________________________________________<BR>
postgis-users mailing list<BR>
postgis-users@postgis.refractions.net<BR>
<A HREF="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>