Sign in to follow this  
Followers 0

Watching my drives fill

1 post in this topic

I'm a geek and want to see trending data of the free space of all my drives (summed up). Here's the cron entry I added:

0 18 * * * date | awk '{print $1", "$2", "$3", "$4", "$6", "}'| head -c -1 | cat >> /home/xlogicx/logs/server_usage.csv; df --total | tail -n 1 | awk '{print $2", "$3", "$4", "$5}' | cat >> /home/xlogicx/logs/server_usage.csv

The csv has this as it's first line initially:

Weekday, Month, Day, Time, Year, Total, Used, Free, Percentage

A sample line that the command produces in the csv is:

Sun, Dec, 17, 18:00:01, 2011, 9511873444, 8248258400, 1227300728, 88%

It runs everyday at 6pm. the --total on df is great for a poor-mans RAID (several independent drives in a server not RAIDed). I specifically don't use -h because it reduces precision; harder to notice subtle changes.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0