Compare commits

..

7 Commits

Author SHA1 Message Date
oleg a0cf2531e6 progress 2024-07-17 09:14:22 -04:00
oleg ada2a74eb6 fix 2024-07-16 15:11:14 -04:00
oleg 7dec83b190 fix 2024-07-16 14:51:21 -04:00
oleg 2b2056171e progress 2024-07-16 14:37:46 -04:00
oleg 913d971663 progress 2024-07-16 12:11:37 -04:00
oleg 0f6d7874de progress 2024-06-13 19:40:49 -04:00
oleg 769d8116d5 fix 2024-06-13 18:17:13 -04:00
5 changed files with 54 additions and 20 deletions
+36
View File
@@ -0,0 +1,36 @@
-------------------------------------
C R Y P T O M A R K E T D A T A
-------------------------------------
============
Exchanges
============
|
v
============
Databases
============
| TimescaleDB: cloud21
| TimescaleDB: cvttdata
v
================
Daily Archive
================
| created by crontabs:
| cvttdata:
| /home/cvtt/prod/utils/archive_yesterday_md.sh cloud21
| /home/cvtt/prod/utils/archive_yesterday_md.sh cvttdata
| stored in:
| /home/cvtt/prod/archive/md_archive/crypto/cloud21
| /home/cvtt/prod/archive/md_archive/crypto/cvttdata
|
v
==========
Storage
==========
| created by crontabs:
| cvttdata:
|
v
==========
Usage
==========
+1 -1
View File
@@ -1 +1 @@
0.8.2.1
0.8.8
+1 -1
View File
@@ -48,7 +48,7 @@ export PYTHONPATH=/home/cvtt/prod
export Python=/home/cvtt/.pyenv/python3.10-venv/bin/python3
export Config=http://cloud16.cvtt.vpn:6789/apps/minimal_md
export PyScript=/home/cvtt/prod/cvttpy/exchanges/alpaca/hist_md/hist_md_bars.py
export OutputDir=/home/cvtt/host_drive/alpaca_md # Local
export OutputDir=/home/cvtt/prod/archive/equities/alpaca_md # Local
export LogDir=/home/cvtt/prod/logs/alpaca_md
# ----- T E M P
+5 -5
View File
@@ -4,14 +4,14 @@ Python=/home/cvtt/.pyenv/python3.10-venv/bin/python3.10
RootDir=/home/cvtt/prod
export PYTHONPATH=${RootDir}
host=$(hostname)
host=${1}
if [ "${host}" == "cvttdata" ]
then
ArchiveRootDir=/home/cvtt/prod/archive/md_archive
ArchiveRootDir=/home/cvtt/prod/archive/md_archive/crypto/cvttdata
CredKey=TSDB_MD_CVTTDATA_RO
elif [ "${host}" == "cloud21.cryptovaltrading.com" ]
elif [ "${host}" == "cloud21" ]
then
ArchiveRootDir=/opt/store/cvtt/archive/md_archive
ArchiveRootDir=/home/cvtt/prod/archive/md_archive/crypto/cloud21
CredKey=TSDB_MD_CLD21_RO
else
echo "Unknown host ${host}. ${0} Aborted."
@@ -21,7 +21,7 @@ fi
mkdir -p ${ArchiveRootDir}
yesterday=$(date -d "yesterday" +%Y%m%d)
Schemas=${1}
Schemas=${2}
if [ "${Schemas}" == "" ]
then
Schemas="coinbase,bnbspot,bnbfut"
+11 -13
View File
@@ -38,19 +38,13 @@ Metrics=()
TempFiles=
function cleanup {
echo Cleaing up temporary files: ${TempFiles}
if [ "" != "${TempFiles}" ]; then
rm -f ${TempFiles}
fi
}
trap cleanup EXIT
function new_tempfile {
tmpfile=$(mktemp)
TempFiles="${TempFiles} ${tmpfile}"
echo ${tmpfile}
}
function space_alert() {
ALERT_USAGE=75%
for metric in "${Metrics[@]}"
@@ -104,8 +98,12 @@ function storage_check() {
done
}
tmpfile=$(new_tempfile)
tmpfile2=$(new_tempfile)
tmpfile=$(mktemp)
TempFiles="${TempFiles} ${tmpfile}"
tmpfile2=$(mktemp)
TempFiles="${TempFiles} ${tmpfile2}"
storage_check > ${tmpfile2}
echo "## :card_file_box: STORAGE HEALTH CHECK" >> ${tmpfile}
@@ -115,14 +113,14 @@ echo "| --- | --- | --- |" >> ${tmpfile}
cat ${tmpfile2} | sort -h -r | awk -F'%' '{printf "%s%%%s\n",$2,$3}' >> ${tmpfile}
cat ${tmpfile} | ${Sender} ${StatusChannel}
Measurements=()
tmpfile=$(new_tempfile)
tmpfile=$(mktemp)
TempFiles="${TempFiles} ${tmpfile}"
space_alert > ${tmpfile}
cat ${tmpfile}
if [ -s ${tmpfile} ]
then
(echo "### :card_file_box: STORAGE ALERTS" && cat ${tmpfile}) | ${Sender} ${AlertChannel}
else
echo File ${tmpfile} is empty
echo "No Storage Alerts"
fi