Web Hosting & VPS Tips

Unleash Your Server Potential with Expert Insights

Hosting provided by: Cloudways
Free to Try! Up to 40% Off!

Category: Bash

Use df—a disk tool—in a Bash script on an AlmaLinux VPS—script:
#!/bin/bash\nUSED=$(df -h / | awk 'NR==2{print $5}' | cut -d% -f1)\n[ $USED -gt 80 ] && echo \"Disk full\" | mail -s \"Alert\" admin@email.com
On DigitalOcean run:
./disk_alert.sh
Alerts hosting admins

Back to All Tips