28aebf0195fe9254b8624931ebc0c46a8ddcf154 gperez2 Sun Mar 31 15:14:41 2024 -0700 Adding a script to replace the checkTableStatus.csh script for the TABLE STATUS dump cron, refs #32812 diff --git src/utils/qa/checkTableStatusDump.sh src/utils/qa/checkTableStatusDump.sh new file mode 100755 index 0000000..1ec072f --- /dev/null +++ src/utils/qa/checkTableStatusDump.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Checks the last TABLE STATUS dump + +# Get the current date in the format "YYYY-MM-DD" +current_date=$(date +%Y-%m-%d) + +# Modify the date for when the cron runs +check_dumped_date=$(date -d "$current_date - 1 day" +%Y-%m-%d) + +# Replace '-' to '.' to match the date output for the last TABLE STATUS dump +check_dumped_date="rr: ${check_dumped_date//-/.}" + +# Get the last TABLE STATUS dump +dumped_date="rr: $(ls -1 /hive/data/outside/genbank/var/tblstats/hgnfs1/ | tail -1)" + +# If statement that checks the last TABLE STATUS dump. +# If the TABLE STATUS dump date does not match the expected date, outputs a message: +# "The RR TABLE STATUS files have not been recently dumped. The latest RR dump was 2024.03.31." +if [ "$check_dumped_date" = "$dumped_date" ]; then + : +else + echo "The RR TABLE STATUS files have not been recently dumped. The latest RR dump was $(ls -1 /hive/data/outside/genbank/var/tblstats/hgnfs1/ | tail -1)." +fi