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.csvThe 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.











