#!/usr/bin/ksh # # wget_usgs_backdata.ksh # # Author: Lydia Philpott (lphilpott@igpp.ucla.edu) # DON'T BOTHER - JUST DO IT BY HAND # Download the monthly zipped one second data files for Barrow from usgs. ## Set environment variables # if [[ -z $THMSOC ]] then THMSOC=/disks/socware/thmsoc_dp_current export THMSOC fi #. $THMSOC/src/config/soc_it_to_me.config # . $THMSOC/src/config/wget_intermagnet_gmag.config tempdir=/home/thmsoc/lphilpotts_stuff/usgs_download logfile=/home/thmsoc/lphilpotts_stuff/usgs_test/wget_log_$$ url=ftp://hazards.cr.usgs.gov/Geomag/OneSecData/BRW1sec/ /usr/bin/wget -r -nH --cut-dirs=3 -N -o $logfile -P $tempdir $url # go through all the files in the tempdir, unzip and cp to mirrordir=/disks/themisdata/thg/mirrors/mag/usgs_ascii/brw/ grep saved $logfile | grep -v listing | awk '{print $6}' > /tmp/wget_usgs_gmag$$ while read path do gunzip -f $path dirname=${path%.zip} done < /tmp/wget_usgs_gmag$$ # ## Cleanup # rm -f /tmp/wget_usgs_gmag$$ exit 0