User Info & Stats¶
Account Status / Quota MOTD¶
A cron job on the server writes a .userinfo file into every SLURM user's home directory, using squota and sshadow to show the group's disk quota and the user's expiration date. This has to run on the server, not the login node — the login node is connected over NFS and doesn't have access to the quota information directly.
First, create the script:
/root/update-user-info.sh
#!/bin/bash
# /root/update-user-info.sh
source /etc/slurm-powerautomate/credentials
for HOME_DIR in /raid_storage/SLURM/home/slurm_*; do
user=$(basename "$HOME_DIR")
# Get quota and expiry
QUOTA=$(sudo squota $user 2>/dev/null)
EXPIRY=$(echo "$LDAP_ADMIN_PASSWORD" | sudo sshadow $user status 2>/dev/null)
# Write to user's home
cat > "$HOME_DIR/.userinfo" << EOF
=== Account Status ===
$EXPIRY
=== Disk Quota ===
$QUOTA
Last updated: $(date '+%Y-%m-%d %H:%M')
EOF
chmod 644 "$HOME_DIR/.userinfo"
done
Then schedule it with cron:
Run it every 30 hours:
Showing It at Login¶
On the login node, create a profile script that displays the details on SSH login:
To make the login banner cleaner, some default MOTD scripts are also disabled:
sudo chmod -x /etc/update-motd.d/50-motd-news
sudo chmod -x /etc/update-motd.d/90-updates-available
sudo chmod -x /etc/update-motd.d/91-release-upgrade
Exporting Full Job History¶
To export the complete job accounting history: