Skip to content

Instantly share code, notes, and snippets.

@leoncamel
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leoncamel/9b8bd11d4d171a5e48b5 to your computer and use it in GitHub Desktop.
Save leoncamel/9b8bd11d4d171a5e48b5 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Reference : http://www.transtats.bts.gov/DL_SelectFields.asp?Table_ID=236&DB_Short_Name=On-Time
#
now=`date +"%Y-%m-%d" -d "01/01/1987"`
end=`date +"%Y-%m-%d" -d "05/01/2015"`
# end=`date +"%Y-%m-%d"`
while [ "$now" != "$end" ] ;
do
now=`date +"%Y-%m-%d" -d "$now + 1 month"`;
now_new=`date +"%Y_%-m" -d "$now"`;
echo "http://www.transtats.bts.gov/Download/On_Time_On_Time_Performance_$now_new.zip"
wget -c "http://www.transtats.bts.gov/Download/On_Time_On_Time_Performance_$now_new.zip"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment