Skip to content

Instantly share code, notes, and snippets.

@nevans
Created March 12, 2010 18:37
Show Gist options
  • Save nevans/330603 to your computer and use it in GitHub Desktop.
Save nevans/330603 to your computer and use it in GitHub Desktop.
disk space for backups
mount |
awk '/ext3/{ print $3 }' |
grep -v '/tmp' |
xargs df |
awk 'NR==1{next}
$4~/%/{ print "+ "$2" ("$5")"; SUM += $2 }
$5~/%/{ print "+ "$3" ("$6")"; SUM += $3 }
END { print "=> " SUM/1024/1024 }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment