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