box-o-sand/postgresql/tutorial/weather/import-data

26 lines
433 B
Plaintext
Raw Normal View History

#!/bin/bash
FTP_BASE='ftp://ftp.ncdc.noaa.gov/pub/data/gsod'
pushd $(dirname $(readlink -f $0))
pushd ./data
if [[ ! -f ish-history.csv ]]
then
curl -O $FTP_BASE/ish-history.csv
fi
for year in 1950 1960 1970 1980 1990 2000 2010
do
tarname=gsod_$year.tar
if [[ ! -f $tarname ]]
then
curl -O $FTP_BASE/$year/$tarname
fi
tar xf $tarname
for gzfile in *-$year.op.gz
do
:
done
done