-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding lustre quota script to disk-usage #90
- Loading branch information
1 parent
1305301
commit 1ae8cfe
Showing
1 changed file
with
25 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |