17 December,2019 by Tom Collins
Question: I need to report on the sum of disk allocated for Linux directories dedicated to DB2 LUW directories . How can I sum the directories disk allocated ?
I've tried various procedures but the sums arent't adding to same totals that are displayed when df - h is printed
Answer: There's a few different ways of getting to the same total . Here's a simple example of the sum of disk allocated for two directories. In the example below - I'm adding disk allocated for /mydir and /mydir/logs
df -h /mydir/ /mydir/logs | awk '{ alloc += $1 } END {print alloc}'
In this example the directories allocated as static . If the requirement was to do something more dynamic - you'll need to put some extra scripting around this code to drop the directory names in the line
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |