Skip to content

Commit

Permalink
adding lustre quota script to disk-usage #90
Browse files Browse the repository at this point in the history
  • Loading branch information
louisegrimble committed Jan 29, 2025
1 parent 1305301 commit 1ae8cfe
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion bin/filesystem/disk-usage/submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,28 @@ printf "%-12s %-6s %-8s %-6s %-6s\n" "---------" "-----" "------" "-----" "-----
# Loop through data
for row in "${data[@]}"; do
printf "%-12s %-6s %-8s %-6s %-6s\n" $row
done
done

####### including lustre quota script ######
#warning limit
warn_int=42

#Percentage equation
lustre_percentage=$(echo $((used_int*100/size_int))'%')

## text of the email
message_lustre="Dear User, \n
\n
The capacity for Lustre (team298) is at $lustre_percentage capacity: \n
Amount used: $lustre_used ($lustre_percentage) \n
Amount available: $lustre_size \n
\n
Please review contents of Lustre directory (/lustre/scratch126/cellgen/team298), and remove content that is no longer essential. \n
\n NOTE:Items that should not be permanently deleted can be stored on iRODS for secure storage. Find Haniffa Lab (Team298) storage space in /archive/team298 \n
\n Thank you."

# this will change to if $used_value is more than 47.5T
if [ "$used_int" -gt "$warn_int" ]; then
# Submit the email
echo -e "$message_lustre" | mail -s "Lustre Quota Alert" [email protected] [email protected] [email protected] [email protected]
fi

0 comments on commit 1ae8cfe

Please sign in to comment.