Created
August 5, 2020 10:00
-
-
Save apergos/ffd4408c05a72a46f2bcd5897e27c7e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# for each host in the list, display the dump type | |
# requires sudo root on snapshot hosts (dumpsgen is not enough) | |
# fixme generate this list from someplace. it would be nicer. | |
hostnums="05 06 07 08 09 10" | |
get_dumptype() { | |
host="$1" | |
# <crontab cruft> /bin/bash /usr/local/bin/fulldumps.sh 01 14 regular full 28 | |
output=$( ssh $host 'sudo grep fulldumps.sh /var/spool/cron/crontabs/dumpsgen 2>/dev/null | head -1' ) | |
if [ -z "$output" ]; then | |
echo "dump type unknown (no cron job entry)" | |
else | |
echo "$output" | /usr/bin/mawk '{ print $9 }' | |
fi | |
} | |
for hostnum in $hostnums; do | |
hostname="snapshot10${hostnum}.eqiad.wmnet" | |
dumptype=$( get_dumptype $hostname ) | |
echo "HOST ${hostname} DUMP TYPE: ${dumptype}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment