Thursday, 22. December 2011 Week 51
Wednesday, 21. December 2011 Week 51
Tuesday, 20. December 2011 Week 51
Monday, 19. December 2011 Week 51

LinuxWorld 2007

Let's start the last week of this badge advent calendar with another tech conference badge (looks like the conference no longer exists, thus no link to any website): San Francisco LinuxWorld 2007

LinuxWorld 2007

Sunday, 18. December 2011 Week 50
Saturday, 17. December 2011 Week 50

check_disk_usage.sh

Quick and dirty way to get an alert before your server starts to go crazy because of a full disk.

This script checks if a disk is more than 75% full.

#!/bin/bash

df -h | awk '/%/ {
        limit = 75
        percent = sprintf("%d",$5)
        if ( percent > limit ) {
                print "Warning: ",$6," (",$1,") is to ",percent,"% full:"
                print $0
        }
}'

Save it under /root/check_disk_usage.sh and create the following crontab entry to check the disk usage every day at half past midnight.

30  0  *   *   *     /root/check_disk_usage.sh

Assuming your host has configured an MTA and defined a recipient for root@<yourhost>, you should get an e-mail whenever a disk is more than 75% full.

Friday, 16. December 2011 Week 50
Thursday, 15. December 2011 Week 50