Created
January 23, 2022 02:45
-
-
Save sbamin/846658509ff574184028a94ef0dd8687 to your computer and use it in GitHub Desktop.
Check disk quota prior to running workflows with 100s of jobs in queue
This file contains hidden or 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
#!/usr/bin/env bash | |
## following will prevent running of queued jobs if tier 1 space is > 99 % | |
tstamp="$(date +%d%b%y_%H%M%S_%Z)" | |
## available files: tier1state.txt, tier2state.txt, faststate.txt | |
## These files updates every 30 min per disk status. | |
diskstat=$(cat /projects/verhaak-lab/verhaak_env/SetEnv/logs/diskstats/tier1state.txt) | |
diskstat=${diskstat:-"NA"} | |
if [[ "${diskstat}" -ge 99 ]]; then | |
printf "ERR\t%s\tTier 1 space is almost full. Exiting now!\tdisk_pct: %s" "${tstamp}" "${diskstat}" | |
exit 1 | |
else | |
echo "All good to go and startin a job!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment