Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f59c729c6f | |||
| df04d764c8 |
@@ -1,7 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
usage() {
|
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
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,11 +22,15 @@ is_valid() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ------- D E F A U L T S
|
||||||
date=""
|
date=""
|
||||||
host=hs01
|
host=hs01
|
||||||
source=cloud21
|
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
|
case ${opt} in
|
||||||
d )
|
d )
|
||||||
date=$OPTARG
|
date=$OPTARG
|
||||||
@@ -34,6 +41,9 @@ while getopts ":h:d:s:" opt; do
|
|||||||
s )
|
s )
|
||||||
source=$OPTARG
|
source=$OPTARG
|
||||||
;;
|
;;
|
||||||
|
t )
|
||||||
|
TargetDir=$OPTARG
|
||||||
|
;;
|
||||||
\? )
|
\? )
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
usage
|
usage
|
||||||
@@ -82,7 +92,6 @@ SourceFile=$(date -d ${date} "+%Y%m%d.mktdata.db")
|
|||||||
SourceFileZip="${SourceFile}.gz"
|
SourceFileZip="${SourceFile}.gz"
|
||||||
SourceFilePath=$(date -d ${date} "+${SourceRootDir}/%Y/%m/${SourceFileZip}")
|
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")
|
TargetFile=$(date -d ${date} "+%Y%m%d.mktdata.ohlcv.db")
|
||||||
TargetFilePath="${TargetDir}/${TargetFile}"
|
TargetFilePath="${TargetDir}/${TargetFile}"
|
||||||
|
|
||||||
|
|||||||
@@ -10,17 +10,22 @@
|
|||||||
|
|
||||||
|
|
||||||
usage() {
|
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
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# --------------------- Settings
|
# --------------------- Settings
|
||||||
SourceHost=cloud21.cvtt.vpn
|
SourceHost=cloud21
|
||||||
SourceRootDir=/opt/store/cvtt/md_archive/crypto
|
SourceRootDir=/opt/store/cvtt/md_archive/crypto
|
||||||
DbSource=cloud21
|
DbSource=cloud21
|
||||||
# --------------------- Settings
|
# --------------------- Settings
|
||||||
|
|
||||||
while getopts ":d:O:" opt; do
|
while getopts ":d:O:S:D:" opt; do
|
||||||
case ${opt} in
|
case ${opt} in
|
||||||
d )
|
d )
|
||||||
Date=$OPTARG
|
Date=$OPTARG
|
||||||
@@ -28,6 +33,12 @@ while getopts ":d:O:" opt; do
|
|||||||
O )
|
O )
|
||||||
OutputDir=$OPTARG
|
OutputDir=$OPTARG
|
||||||
;;
|
;;
|
||||||
|
S )
|
||||||
|
SourceHost=$OPTARG
|
||||||
|
;;
|
||||||
|
D )
|
||||||
|
DbSource=$OPTARG
|
||||||
|
;;
|
||||||
\? )
|
\? )
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
usage
|
usage
|
||||||
@@ -46,6 +57,8 @@ fi
|
|||||||
if [ -z ${OutputDir} ] ; then
|
if [ -z ${OutputDir} ] ; then
|
||||||
OutputDir=.
|
OutputDir=.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
SourceHost+=".cvtt.vpn"
|
||||||
mkdir -p ${OutputDir}
|
mkdir -p ${OutputDir}
|
||||||
|
|
||||||
# --- Binance
|
# --- Binance
|
||||||
|
|||||||
Reference in New Issue
Block a user