Jump to content


Photo
- - - - -

Watching my drives fill


  • Please log in to reply
No replies to this topic

#1 XlogicX

XlogicX

    SUP3R 31337

  • Validating
  • 160 posts
  • Gender:Male
  • Location:Tempe (Phoenix area)

Posted 18 December 2011 - 09:22 AM

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.




BinRev is hosted by the great people at Lunarpages!