load histdata
This commit is contained in:
parent
661d0126fc
commit
6f78a32734
58
research/load_histdata.sh
Executable file
58
research/load_histdata.sh
Executable file
@ -0,0 +1,58 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
root_dir=/home/oleg/store/eqt_hist_md
|
||||||
|
|
||||||
|
log_dir=${root_dir}/logs
|
||||||
|
url_root="https://firstratedata.com/datafile/89CgWiwc60CylOIEFRDTCg"
|
||||||
|
|
||||||
|
mkdir -p ${log_dir}
|
||||||
|
|
||||||
|
link_letter_pairs=(
|
||||||
|
[13580]=AB
|
||||||
|
[13585]=CD
|
||||||
|
[13590]=EF
|
||||||
|
[13595]=GH
|
||||||
|
[13600]=IJ
|
||||||
|
[13605]=KL
|
||||||
|
[12509]=MN
|
||||||
|
[13610]=OP
|
||||||
|
[13615]=QR
|
||||||
|
[13620]=ST
|
||||||
|
[13625]=UV
|
||||||
|
[13630]=WX
|
||||||
|
[13635]=YZ
|
||||||
|
# [14033]=week_update
|
||||||
|
)
|
||||||
|
|
||||||
|
function load_zipfile {
|
||||||
|
key=${1}
|
||||||
|
letter_pair=${link_letter_pairs[$key]}
|
||||||
|
out_file="${out_dir}/${letter_pair}_tickers.zip"
|
||||||
|
url=${url_root}/${key}
|
||||||
|
log_file="${log_dir}/${today}.tickers_download.log"
|
||||||
|
|
||||||
|
cmd="wget --no-verbose -O ${out_file} ${url} |tee -a ${log_file} 2>&1"
|
||||||
|
echo ${cmd} | tee -a ${log_file}
|
||||||
|
eval ${cmd}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
today=$(date '+%Y%m%d')
|
||||||
|
out_dir=${root_dir}/${today}
|
||||||
|
|
||||||
|
mkdir -p ${out_dir}
|
||||||
|
|
||||||
|
keys=${*}
|
||||||
|
|
||||||
|
if [ "${keys}" == "" ]
|
||||||
|
then
|
||||||
|
keys="${!link_letter_pairs[@]}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "keys=${keys}"
|
||||||
|
for key in ${keys}
|
||||||
|
do
|
||||||
|
load_zipfile ${key}
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "${0} Done...." | tee -a ${log_file}
|
||||||
Loading…
x
Reference in New Issue
Block a user