《Hadoop权威指南》(Hadoop:The Definitive Guide) 气象数据集下载脚本

从网上找到一个脚本,修改了一下

#!/bin/bash

CURRENT_DIR=$(cd `dirname $0`; pwd)

[ -e $CURRENT_DIR/ncdc ] || mkdir $CURRENT_DIR/ncdc
[ -e $CURRENT_DIR/ncdc/files ] || mkdir $CURRENT_DIR/ncdc/files

for i in `seq 1901 2012`
do
    cd $CURRENT_DIR/ncdc/
    wget -r -np -nH .cut-dirs=3 -R index.html http://ftp3.ncdc.noaa.gov/pub/data/noaa/$i/
    cd pub/data/noaa/$i/
    cp *.gz $CURRENT_DIR/ncdc/files
    cd $CURRENT_DIR/ncdc/
    rm -r pub/
done

  

你可能感兴趣的:(hadoop)