Skip to content

Instantly share code, notes, and snippets.

@elchappo
Created November 14, 2012 16:07
Show Gist options
  • Save elchappo/4072999 to your computer and use it in GitHub Desktop.
Save elchappo/4072999 to your computer and use it in GitHub Desktop.
Bash script to monitor /tmp folder on the server
#!/bin/sh
tmp_usage=$(df -h /tmp/ | tail -1 | awk '{print $4}' | awk -F "%" '{print $1}')
if [ $tmp_usage -gt 90 ]; then
echo "Your /tmp folder is $tmp_usage% full, please investigate" | mail -s "TMP folder on <server-id>" [email protected];
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment