0

I'm running nation_script_load.sh but I'm getting several errors and the data isn't been downloaded:

First one is:

HTTP request sent, awaiting response... 304 Not Modified

Second one:

rm: cannot remove '/tmp/gis/gisdata/temp//www2.census.gov': Is a directory
nation_script_load.sh: 17: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 18: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found

Because of this I'm not getting any file downloaded.

Bellow the full log:

ubuntu@ip-172-31-30-115:/tmp$ sudo  sh nation_script_load.sh 
URL transformed to HTTPS due to an HSTS policy
--2017-07-17 17:35:57--  https://www2.census.gov/geo/tiger/TIGER2016/STATE/tl_2016_us_state.zip
Resolving www2.census.gov (www2.census.gov)... 104.68.125.234, 2600:1406:20:19e::208c, 2600:1406:20:1a0::208c
Connecting to www2.census.gov (www2.census.gov)|104.68.125.234|:443... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘www2.census.gov/geo/tiger/TIGER2016/STATE/tl_2016_us_state.zip’ not modified on server. Omitting download.

rm: cannot remove '/tmp/gis/gisdata/temp//www2.census.gov': Is a directory
nation_script_load.sh: 17: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 18: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
Archive:  tl_2016_us_state.zip
 extracting: /tmp/gis/gisdata/temp/tl_2016_us_state.cpg  
  inflating: /tmp/gis/gisdata/temp/tl_2016_us_state.dbf  
  inflating: /tmp/gis/gisdata/temp/tl_2016_us_state.prj  
  inflating: /tmp/gis/gisdata/temp/tl_2016_us_state.shp  
  inflating: /tmp/gis/gisdata/temp/tl_2016_us_state.shp.ea.iso.xml  
  inflating: /tmp/gis/gisdata/temp/tl_2016_us_state.shp.iso.xml  
  inflating: /tmp/gis/gisdata/temp/tl_2016_us_state.shp.xml  
  inflating: /tmp/gis/gisdata/temp/tl_2016_us_state.shx  
nation_script_load.sh: 22: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 23: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/shp2pgsql: not found
nation_script_load.sh: 23: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 24: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 25: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 26: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
URL transformed to HTTPS due to an HSTS policy
--2017-07-17 17:35:57--  https://www2.census.gov/geo/tiger/TIGER2016/COUNTY/tl_2016_us_county.zip
Resolving www2.census.gov (www2.census.gov)... 104.68.125.234, 2600:1406:20:1a0::208c, 2600:1406:20:19e::208c
Connecting to www2.census.gov (www2.census.gov)|104.68.125.234|:443... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘www2.census.gov/geo/tiger/TIGER2016/COUNTY/tl_2016_us_county.zip’ not modified on server. Omitting download.

rm: cannot remove '/tmp/gis/gisdata/temp//www2.census.gov': Is a directory
nation_script_load.sh: 31: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 32: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
Archive:  tl_2016_us_county.zip
 extracting: /tmp/gis/gisdata/temp/tl_2016_us_county.cpg  
  inflating: /tmp/gis/gisdata/temp/tl_2016_us_county.dbf  
  inflating: /tmp/gis/gisdata/temp/tl_2016_us_county.prj  
  inflating: /tmp/gis/gisdata/temp/tl_2016_us_county.shp  
  inflating: /tmp/gis/gisdata/temp/tl_2016_us_county.shp.ea.iso.xml  
  inflating: /tmp/gis/gisdata/temp/tl_2016_us_county.shp.iso.xml  
  inflating: /tmp/gis/gisdata/temp/tl_2016_us_county.shp.xml  
  inflating: /tmp/gis/gisdata/temp/tl_2016_us_county.shx  
nation_script_load.sh: 36: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 37: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/shp2pgsql: not found
nation_script_load.sh: 37: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 38: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 39: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 40: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 41: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 42: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 43: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found
nation_script_load.sh: 44: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found

EDIT:

I did:

which psql

The ouput was:

/usr/bin/psql

But I can't go to that location:

cd /usr/bin/psql

-bash: cd: /usr/bin/psql: Not a directory

I can only change to:

/usr/bin/
1

It looks like you have the path to your postgresql bin set wrong.

This is the cause of your problems

nation_script_load.sh: 36: nation_script_load.sh: /usr/lib/postgresql/9.3/bin/psql: not found

/usr/lib/postgresql/9.3/bin/shp2pgsql

You might have it set as part of your default env path, in which case you might be able to omit the variable path in the .sh script.

alternatively set path right

check with

which psql

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.