63 lines
1.7 KiB
Bash
Executable File
63 lines
1.7 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')
|
|
mn=$(date -d 'yesterday' '+%m')
|
|
|
|
declare -A Commands
|
|
Commands=(
|
|
["hs01:cloud24"]="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cloud24/${yr}/${mn} | tail -5"
|
|
["hs01:cloud28"]="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cloud28/${yr}/${mn} | tail -5"
|
|
["hs01:sim"]="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/sim/ | tail -5"
|
|
["cloud21:cloud24"]="ssh cvtt@cloud21.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cloud24/${yr}/${mn} | tail -5"
|
|
["cloud21:cloud28"]="ssh cvtt@cloud21.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cloud28/${yr}/${mn} | tail -5"
|
|
["cloud21:sim"]="ssh cvtt@cloud21.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/sim | tail -5"
|
|
["gpushnik"]="ssh oleg@gpushnik.cvtt.vpn 'ls -l /opt/jupyter_gpu/data/crypto_md | tail -10'"
|
|
)
|
|
|
|
for name in $(printf "%s\n" "${!Commands[@]}" | sort); do
|
|
Cmd=${Commands[${name}]}
|
|
echo "---------------------- ${name}"
|
|
echo ${Cmd}
|
|
echo
|
|
eval ${Cmd}
|
|
echo
|
|
done
|
|
}
|
|
|
|
tmpfile=$(mktemp)
|
|
function cleanup {
|
|
cd ${HOME}
|
|
rm -f ${tmpfile}
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
echo "## :hearts: CRYPTO MD HEALTH CHECK (cvtt-md.cvtt.vpn)" >> ${tmpfile}
|
|
echo '```' >> ${tmpfile}
|
|
run_checklist >> ${tmpfile}
|
|
echo '```' >> ${tmpfile}
|
|
|
|
cat ${tmpfile} | ${Sender} ${StatusChannel}
|
|
|
|
cat $tmpfile
|
|
|