Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f61518ae20 | |||
| 25fd9ab3c4 | |||
| 66b5cd16dd | |||
| 1db0d08547 | |||
| b61c3a684a | |||
| 78382df12d |
+1
-1
@@ -1 +1 @@
|
|||||||
1.6.1,trading recorder -> docker
|
1.6.3F2,homestore /works/cvtt ownership moved to cvtt
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ if [ "${host}" == "cloud21" ] ; then
|
|||||||
SourceRootDir="/opt/store/cvtt/md_archive/crypto/${source}"
|
SourceRootDir="/opt/store/cvtt/md_archive/crypto/${source}"
|
||||||
elif [ "${host}" == "homestore" ]; then
|
elif [ "${host}" == "homestore" ]; then
|
||||||
SourceHost=homestore.cvtt.vpn
|
SourceHost=homestore.cvtt.vpn
|
||||||
SourceUser=oleg
|
SourceUser=cvtt
|
||||||
SourceRootDir=/works/cvtt/md_archive/crypto/${source}
|
SourceRootDir=/works/cvtt/md_archive/crypto/${source}
|
||||||
else
|
else
|
||||||
usage
|
usage
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ usage() {
|
|||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ "$(uname)" == "Darwin" ]]; then
|
if [[ "$(uname)" == "Darwin" ]]; then
|
||||||
# macOS
|
# macOS
|
||||||
date='gdate'
|
date='gdate'
|
||||||
@@ -22,6 +23,8 @@ host=homestore
|
|||||||
stocks=COIN,GBTC,SQ
|
stocks=COIN,GBTC,SQ
|
||||||
|
|
||||||
TargetDir="/opt/jupyter_gpu/data/eqty_md"
|
TargetDir="/opt/jupyter_gpu/data/eqty_md"
|
||||||
|
# TargetDir="/tmp" # -------= D E B U G
|
||||||
|
|
||||||
mkdir -p ${TargetDir}
|
mkdir -p ${TargetDir}
|
||||||
|
|
||||||
Table=md_1min_bars
|
Table=md_1min_bars
|
||||||
@@ -88,7 +91,6 @@ TargetFile=$(${date} -d ${md_date} "+%Y%m%d.eqty.mktdata.ohlcv.db")
|
|||||||
|
|
||||||
TargetFilePath="${TargetDir}/${TargetFile}"
|
TargetFilePath="${TargetDir}/${TargetFile}"
|
||||||
mv ${TargetFilePath} "${TargetFilePath}.saved.$(${date} '+%Y%m%d_%H%M%S')"
|
mv ${TargetFilePath} "${TargetFilePath}.saved.$(${date} '+%Y%m%d_%H%M%S')"
|
||||||
touch ${TargetFilePath}
|
|
||||||
|
|
||||||
# ---- temp dir
|
# ---- temp dir
|
||||||
echo ${SourceFile}
|
echo ${SourceFile}
|
||||||
@@ -108,7 +110,7 @@ if [ "${host}" == "cloud21" ] ; then
|
|||||||
SourceRootDir="/opt/store/cvtt/md_archive/equity/alpaca_md"
|
SourceRootDir="/opt/store/cvtt/md_archive/equity/alpaca_md"
|
||||||
elif [ "${host}" == "homestore" ]; then
|
elif [ "${host}" == "homestore" ]; then
|
||||||
SourceHost=homestore.cvtt.vpn
|
SourceHost=homestore.cvtt.vpn
|
||||||
SourceUser=oleg
|
SourceUser=cvtt
|
||||||
SourceRootDir="/works/cvtt/md_archive/equity/alpaca_md"
|
SourceRootDir="/works/cvtt/md_archive/equity/alpaca_md"
|
||||||
else
|
else
|
||||||
usage
|
usage
|
||||||
@@ -146,6 +148,7 @@ function download_file {
|
|||||||
echo ${Cmd} && eval ${Cmd}
|
echo ${Cmd} && eval ${Cmd}
|
||||||
|
|
||||||
DbFile=${tmp_dir}/${SourceFile}
|
DbFile=${tmp_dir}/${SourceFile}
|
||||||
|
touch ${TargetFilePath}
|
||||||
|
|
||||||
|
|
||||||
# --- T E M P - for files older than 20240813
|
# --- T E M P - for files older than 20240813
|
||||||
@@ -173,8 +176,10 @@ for stock in "${Stocks[@]}"; do
|
|||||||
download_file ${SourceFilePath}
|
download_file ${SourceFilePath}
|
||||||
done
|
done
|
||||||
|
|
||||||
chmod 600 ${TargetFilePath}
|
if [ -f ${TargetFilePath} ]; then
|
||||||
ls -lh ${TargetFilePath}
|
chmod 600
|
||||||
|
ls -lh ${TargetFilePath}
|
||||||
|
fi
|
||||||
|
|
||||||
# mkdir -p /tmp/aaa
|
# mkdir -p /tmp/aaa
|
||||||
# cp -r ${tmp_dir}/* /tmp/aaa/
|
# cp -r ${tmp_dir}/* /tmp/aaa/
|
||||||
|
|||||||
Executable
+88
@@ -0,0 +1,88 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo -n "Usage: ${0}"
|
||||||
|
echo -n " [-c <config (dflt: apps/cvtt_eqt_alpaca)>]"
|
||||||
|
echo -n " [-s <config_serverice (dflt: http://cloud23.cvtt.vpn:6789)>]"
|
||||||
|
echo -n " [-N <name (dflt: ALPACA-SNDBX)>]"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Python="${HOME}/.pyenv/python3.10-venv/bin/python3.10"
|
||||||
|
RootDir="${HOME}/prod"
|
||||||
|
|
||||||
|
# **** D E B U G
|
||||||
|
RootDir=/home/oleg/develop/cvtt2
|
||||||
|
# **** D E B U G
|
||||||
|
|
||||||
|
|
||||||
|
export PYTHONPATH=${RootDir}
|
||||||
|
|
||||||
|
StatusChannel=Status-CVTT
|
||||||
|
AlertChannel=Alerts-CVTT
|
||||||
|
Sender=${RootDir}/ops/utils/send_mmost.sh
|
||||||
|
ConfigService=http://cloud23.cvtt.vpn:6789
|
||||||
|
Config=apps/cvtt_eqt_alpaca
|
||||||
|
Name="ALPACA-SNDBX"
|
||||||
|
|
||||||
|
echo $0 $* | /usr/bin/ts '[%Y-%m-%d %H:%M:%S]'
|
||||||
|
|
||||||
|
while getopts ":s:c:n:" opt; do
|
||||||
|
case ${opt} in
|
||||||
|
c )
|
||||||
|
Config=$OPTARG
|
||||||
|
;;
|
||||||
|
s )
|
||||||
|
ConfigService=$OPTARG
|
||||||
|
;;
|
||||||
|
n )
|
||||||
|
Name=$OPTARG
|
||||||
|
;;
|
||||||
|
\? )
|
||||||
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
: )
|
||||||
|
echo "Option -$OPTARG requires an argument." >&2
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# ----- For DEBUGGING
|
||||||
|
# Sender=cat
|
||||||
|
# StatusChannel=
|
||||||
|
|
||||||
|
tmpfile=$(mktemp)
|
||||||
|
function cleanup {
|
||||||
|
# echo Cleaing up temporary files: ${TempFiles}
|
||||||
|
if [ "" != "${TempFiles}" ]; then
|
||||||
|
rm -f ${TempFiles}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
|
||||||
|
Cmd="${Python}"
|
||||||
|
Cmd="${Cmd} ${RootDir}/cvttpy/apps/utils/services_checker.py"
|
||||||
|
Cmd="${Cmd} --config=${ConfigService}/${Config}"
|
||||||
|
Cmd="${Cmd} --log_level=ERROR"
|
||||||
|
Cmd="${Cmd} --log_stdout"
|
||||||
|
Cmd="${Cmd} | tee ${tmpfile} 2>&1"
|
||||||
|
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd}
|
||||||
|
|
||||||
|
cat ${tmpfile}
|
||||||
|
exit
|
||||||
|
|
||||||
|
|
||||||
|
# echo "## :card_file_box: STORAGE HEALTH CHECK" >> ${tmpfile}
|
||||||
|
# echo >> ${tmpfile}
|
||||||
|
# echo "| host | filesystem | usage |" >> ${tmpfile}
|
||||||
|
# echo "| --- | --- | --- |" >> ${tmpfile}
|
||||||
|
# cat ${tmpfile2} | sort -h -r | awk -F'%' '{printf "%s%%%s\n",$2,$3}' >> ${tmpfile}
|
||||||
|
# cat ${tmpfile} | ${Sender} ${StatusChannel}
|
||||||
|
|
||||||
@@ -25,8 +25,8 @@ run_checklist() {
|
|||||||
|
|
||||||
declare -A Commands
|
declare -A Commands
|
||||||
Commands=(
|
Commands=(
|
||||||
["homestore:cloud21"]="ssh oleg@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cloud21/${yr}/${mn} | tail -5"
|
["homestore:cloud21"]="ssh cvtt@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cloud21/${yr}/${mn} | tail -5"
|
||||||
["homestore:cvttdata"]="ssh oleg@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cvttdata/${yr}/${mn} | tail -5"
|
["homestore:cvttdata"]="ssh cvtt@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cvttdata/${yr}/${mn} | tail -5"
|
||||||
["cloud21:cloud21"]="ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/crypto/cloud21/${yr}/${mn} | tail -5"
|
["cloud21:cloud21"]="ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/crypto/cloud21/${yr}/${mn} | tail -5"
|
||||||
["cloud21:cvttdata"]="ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/crypto/cvttdata/${yr}/${mn} | tail -5"
|
["cloud21:cvttdata"]="ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/crypto/cvttdata/${yr}/${mn} | tail -5"
|
||||||
["gpushnik"]="ssh oleg@gpushnik.cvtt.vpn 'ls -l /opt/jupyter_gpu/data/crypto_md | tail -10'"
|
["gpushnik"]="ssh oleg@gpushnik.cvtt.vpn 'ls -l /opt/jupyter_gpu/data/crypto_md | tail -10'"
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ run_checklist() {
|
|||||||
yr=$(date -d 'yesterday' '+%Y')
|
yr=$(date -d 'yesterday' '+%Y')
|
||||||
|
|
||||||
declare -A Commands
|
declare -A Commands
|
||||||
Commands["homestore"]="ssh oleg@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/A/AAPL/${yr} | tail -3"
|
Commands["homestore"]="ssh cvtt@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/A/AAPL/${yr} | tail -3"
|
||||||
Commands["homestore"]+="; echo"
|
Commands["homestore"]+="; echo"
|
||||||
Commands["homestore"]+="; ssh oleg@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/N/NVDA/${yr} | tail -3"
|
Commands["homestore"]+="; ssh cvtt@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/N/NVDA/${yr} | tail -3"
|
||||||
|
|
||||||
Commands["cloud21"]="ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/equity/alpaca_md/A/AAPL/${yr} | tail -3"
|
Commands["cloud21"]="ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/equity/alpaca_md/A/AAPL/${yr} | tail -3"
|
||||||
Commands["cloud21"]+="; echo"
|
Commands["cloud21"]+="; echo"
|
||||||
@@ -58,14 +58,12 @@ echo '```' >> ${tmpfile}
|
|||||||
|
|
||||||
cat ${tmpfile} | ${Sender} ${StatusChannel}
|
cat ${tmpfile} | ${Sender} ${StatusChannel}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
exit
|
exit
|
||||||
# homestore
|
# homestore
|
||||||
echo homestore
|
echo homestore
|
||||||
ssh oleg@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/A/AAPL/${yr} | tail -3
|
ssh cvtt@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/A/AAPL/${yr} | tail -3
|
||||||
echo
|
echo
|
||||||
ssh oleg@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/N/NVDA/${yr} | tail -3
|
ssh cvtt@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/N/NVDA/${yr} | tail -3
|
||||||
|
|
||||||
echo cloud21
|
echo cloud21
|
||||||
ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/equity/alpaca_md/A/AAPL/${yr} | tail -3
|
ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/equity/alpaca_md/A/AAPL/${yr} | tail -3
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Source=/home/cvtt/prod/archive/md_archive/
|
Source=/home/cvtt/prod/archive/md_archive/
|
||||||
Targets=
|
Targets=
|
||||||
Targets="${Targets} oleg@homestore.cvtt.vpn:/works/cvtt/md_archive/"
|
Targets="${Targets} cvtt@homestore.cvtt.vpn:/works/cvtt/md_archive/"
|
||||||
Targets="${Targets} cvtt@cloud21.cvtt.vpn:/opt/store/cvtt/md_archive/"
|
Targets="${Targets} cvtt@cloud21.cvtt.vpn:/opt/store/cvtt/md_archive/"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user