Merge branch 'master' of cloud21.cvtt.vpn:/opt/store/git/cvtt2/ops

This commit is contained in:
2025-05-15 18:28:08 -04:00
6 changed files with 84 additions and 25 deletions
+12 -3
View File
@@ -1,7 +1,10 @@
#!/usr/bin/env bash
usage() {
echo "Usage: $0 [-h <host (hs01*/cloud21)>] [-d <YYYYMMDD> (yesterday*)] [-s <source> (cvttdata/cloud21*)>]"
echo -n "Usage: $0 [-h <host (hs01*/cloud21)>]"
echo -n " [-d <YYYYMMDD> (yesterday*)]"
echo -n " [-s <source> (cvttdata/cloud21*)>]"
echo " [-t <target_dir> (/opt/jupyter_gpu/data/crypto_md)]"
exit 1
}
@@ -19,11 +22,15 @@ is_valid() {
return 1
}
# ------- D E F A U L T S
date=""
host=hs01
source=cloud21
TargetDir="/opt/jupyter_gpu/data/crypto_md"
# ------- D E F A U L T S
while getopts ":h:d:s:" opt; do
while getopts ":h:d:s:t:" opt; do
case ${opt} in
d )
date=$OPTARG
@@ -34,6 +41,9 @@ while getopts ":h:d:s:" opt; do
s )
source=$OPTARG
;;
t )
TargetDir=$OPTARG
;;
\? )
echo "Invalid option: -$OPTARG" >&2
usage
@@ -82,7 +92,6 @@ SourceFile=$(date -d ${date} "+%Y%m%d.mktdata.db")
SourceFileZip="${SourceFile}.gz"
SourceFilePath=$(date -d ${date} "+${SourceRootDir}/%Y/%m/${SourceFileZip}")
TargetDir="/opt/jupyter_gpu/data/crypto_md"
TargetFile=$(date -d ${date} "+%Y%m%d.mktdata.ohlcv.db")
TargetFilePath="${TargetDir}/${TargetFile}"
+16 -3
View File
@@ -10,17 +10,22 @@
usage() {
echo "Usage: $0 -d YYYMMDD Date> [-O <output dir (./) >]"
echo -n "Usage: $0"
echo -n " -d YYYMMDD Date>"
echo -n " [-O <output dir (./) >]"
echo -n " [-S <archive_source_host (cloud21)>]"
echo -n " [-D <orig_db_source> (cloud21)]"
echo
exit 1
}
# --------------------- Settings
SourceHost=cloud21.cvtt.vpn
SourceHost=cloud21
SourceRootDir=/opt/store/cvtt/md_archive/crypto
DbSource=cloud21
# --------------------- Settings
while getopts ":d:O:" opt; do
while getopts ":d:O:S:D:" opt; do
case ${opt} in
d )
Date=$OPTARG
@@ -28,6 +33,12 @@ while getopts ":d:O:" opt; do
O )
OutputDir=$OPTARG
;;
S )
SourceHost=$OPTARG
;;
D )
DbSource=$OPTARG
;;
\? )
echo "Invalid option: -$OPTARG" >&2
usage
@@ -46,6 +57,8 @@ fi
if [ -z ${OutputDir} ] ; then
OutputDir=.
fi
SourceHost+=".cvtt.vpn"
mkdir -p ${OutputDir}
# --- Binance