73 lines
1.8 KiB
Bash
Executable File
73 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
usage() {
|
|
echo -n "Usage: ${0}"
|
|
echo
|
|
exit 1
|
|
}
|
|
|
|
RootDir="${HOME}/prod"
|
|
|
|
export PYTHONPATH=${RootDir}
|
|
|
|
StatusChannel="MD-Status"
|
|
Sender=${RootDir}/ops/utils/send_mmost.sh
|
|
|
|
# ----- For DEBUGGING
|
|
# RootDir=/home/oleg/develop/cvtt2 ###### D E B U G
|
|
# Sender=cat #### D E B U G
|
|
# StatusChannel= #### D E B U G
|
|
|
|
run_checklist() {
|
|
|
|
|
|
yr=$(date -d 'yesterday' '+%Y')
|
|
CheckSymbols="A/AAPL N/NVDA M/META"
|
|
declare -A Commands
|
|
Commands["hs01"]=""
|
|
for sym in ${CheckSymbols}; do
|
|
Commands["hs01"]+="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/${yr}/${sym} | tail -3; "
|
|
done
|
|
Commands["hs01"]+="echo"
|
|
Commands["hs01:sim"]="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/sim | tail -5"
|
|
|
|
Commands["cloud21"]=""
|
|
for sym in ${CheckSymbols}; do
|
|
Commands["cloud21"]+="ssh cvtt@cloud21.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/${yr}/${sym} | tail -3; "
|
|
done
|
|
Commands["cloud21"]+="echo"
|
|
Commands["cloud21:sim"]="ssh cvtt@cloud21.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/sim | tail -5"
|
|
|
|
Commands["gpushnik"]="ssh oleg@gpushnik.cvtt.vpn 'ls -l /opt/jupyter_gpu/data/eqty_md | tail -10'"
|
|
|
|
for name in $(printf "%s\n" "${!Commands[@]}" | sort); do
|
|
echo "------- ${name}"
|
|
Cmd=${Commands[${name}]}
|
|
echo ${Cmd}
|
|
eval ${Cmd}
|
|
done
|
|
}
|
|
|
|
tmpfile=$(mktemp)
|
|
function cleanup {
|
|
cd ${HOME}
|
|
rm -f ${tmpfile}
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
# run_checklist
|
|
|
|
tmpfile=$(mktemp)
|
|
function cleanup {
|
|
cd ${HOME}
|
|
rm -f ${tmpfile}
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
echo "## :fire: EQUITY MD HEALTH CHECK (cryptoval4)" >> ${tmpfile}
|
|
echo '```' | tee -a ${tmpfile}
|
|
run_checklist | tee -a ${tmpfile}
|
|
echo '```' | tee -a ${tmpfile}
|
|
|
|
echo "Sending result to ${Sender} ${StatusChannel}"
|
|
cat ${tmpfile} | ${Sender} ${StatusChannel} |