md archive

This commit is contained in:
Oleg Sheynin 2023-12-06 15:28:01 -05:00
parent 78759b8c34
commit 5aa9bb323a
2 changed files with 18 additions and 5 deletions

View File

@ -1 +1 @@
0.3.2 0.3.3

View File

@ -4,7 +4,20 @@ Python=/home/cvtt/.pyenv/python3.10-venv/bin/python3.10
RootDir=/home/cvtt/prod RootDir=/home/cvtt/prod
export PYTHONPATH=${RootDir} export PYTHONPATH=${RootDir}
#dates=$(start=20231107; end=20231118; dt=; n=0; until [ "$dt" = "$end" ]; do ((n++)); dt=$(date -d "$start + $n days" +%Y%m%d); echo $dt; done) host=$(hostname)
if [ "${host}" == "cryptoval1" ]
ArchiveRootDir=/localdisk/cvtt/archive/md_archive
CredKey=TSDB_MD_CV1_RO
then
elif [ "${host}" == "cloud19.cryptovaltrading.com" ]
ArchiveRootDir=/opt/cvtt/archive/md_archive
CredKey=TSDB_MD_CLD19_RO
else
echo "Unknown host ${host}. ${0} Aborted."
exit 1
fi
mkdir -p ${ArchiveRootDir}
yesterday=$(date -d "yesterday" +%Y%m%d) yesterday=$(date -d "yesterday" +%Y%m%d)
Schemas=${1} Schemas=${1}
@ -18,15 +31,15 @@ Cmd=
Cmd="${Python}" Cmd="${Python}"
Cmd="${Cmd} ${RootDir}/cvttpy/research/utils/archive_ts_md.py" Cmd="${Cmd} ${RootDir}/cvttpy/research/utils/archive_ts_md.py"
Cmd="${Cmd} --config=http://cloud16.cvtt.vpn:6789/apps/md_recorder" Cmd="${Cmd} --config=http://cloud16.cvtt.vpn:6789/apps/md_recorder"
Cmd="${Cmd} --db_credentials_key=TSDB_MD_CV1" Cmd="${Cmd} --db_credentials_key=${CredKey}"
Cmd="${Cmd} --date=${yesterday}" Cmd="${Cmd} --date=${yesterday}"
Cmd="${Cmd} --schemas=${Schemas}" Cmd="${Cmd} --schemas=${Schemas}"
Cmd="${Cmd} --root_dir=/localdisk/cvtt/archive/md_archive" Cmd="${Cmd} --root_dir=${ArchiveRootDir}"
Cmd="${Cmd} --format=SQLite" Cmd="${Cmd} --format=SQLite"
Cmd="${Cmd} --compress" Cmd="${Cmd} --compress"
echo ${Cmd} echo ${Cmd}
eval ${Cmd} eval ${Cmd}
echo "${0} ${*} Done."