what I’m trying to achieve is the following…
we get alerted when root filesystems fill up to >90%
I’d like a script that reports the following information:-
a “du -ks” for every dir mounted under the / dir NOT including those dir’s which are mounted on their own filesystems but are still mounted under /
eg: if I do a “du -ks *” from / I get the size of each dir.
what I’d like is for this report to ignore all those dirs which are mounted on their own (soft)partition.
I can get a list of dir’s using “ls -lp / | grep / | awk ‘{print $9}’”
I can get a list of seperately mounted filesystems using “df -k | awk ‘{print $6}’”
what I can’t do is get my head around how I to do a “du -ks” on each dir that appears in the output of the first command but doesn’t appear in the output of the 2nd.
I hope I made that clear
any help much appreciated - I’m lost in world of foreach and while loops atm