[NTLUG:Discuss] total drive size
Rev. wRy
slot0k at pogox.org
Wed Mar 12 11:25:47 CST 2003
Bishop, Cass wrote:
> What I was hoping for is a command, or series of commands that can get the
> info for each partition then total it up for me. I have started with this
> to get a list of partition sizes but I'm not sure what to do with it now. I
> need to total this number and make it human readable(like the df -h option).
>
> df|cut -c 20-29|grep -v block
ssh user at host df | awk '{print $3,$4}' > host.df
Should get you started. cat all your *.df files together, work a little
awk magic(1) to get the totals, then convert to K/M/G or whatever you
prefer.
> I'd like to make it a single command string to run from a single box to all
> of my other ones using ssh. Does anyone have any tips?
This would assume that you have a private key set up for each box you
are sshing into, so that no interaction is required from the script and
that you don't have duplicate mount points on the same system, ie a
slice isn't mounted in more than one place.
> Cass
Ry
1) A google groups search on 'add columns awk df' gave several examples.
More information about the Discuss
mailing list