Created
February 3, 2016 23:58
-
-
Save phact/4c0a9a9144533313f44f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dt=`date +%D` | |
log="du.log" | |
df > /tmp/du$$ | |
while read line | |
do | |
fields=`echo $line | awk '{print NF}'` | |
case $fields in | |
5) echo -n "$dt " >> $log | |
echo $line | awk '{print $5,$4}' >> $log;; | |
6) echo -n "$dt " >> $log | |
echo $line | awk '{print $6,$5}' >> $log;; | |
9) echo -n "$dt " >> $log | |
echo $line | awk '{print $8,$9}' >> $log;; | |
10) echo -n "$dt " >> $log | |
echo $line | awk '{print $9,$10}' >> $log;; | |
esac | |
done < /tmp/du$$ | |
rm /tmp/du$$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment