- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- grep file system percentage above 60 %
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2015 03:13 AM
04-07-2015 03:13 AM
grep file system percentage above 60 %
Hi
I am trying to find the file system percentage which is above 60 %.
# bdf | awk -F" " '{ if ($5 > 65) print $5, $6}'| sort -r
80% /home
78% /tmp
75% /var/opt/ignite/recovery/archives/prod
71% /var/adm/crash
71% /opt
above command is successfull,but there is one more mount point "/var/opt/ignite/recovery/archives/nonprod" which is greater than 65%,but I am not getting the output for "/var/opt/ignite/recovery/archives/nonprod".
my doubt is since it uses same "var/opt/ignite/recovery/archives" I guess above bdf command is not reporting correct answer that I am expecting.
What could be done to fix it.
Regards
Madhu
- Tags:
- bdf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2015 11:28 AM
04-07-2015 11:28 AM
Re: grep file system percentage above 60%
>I am not getting the output for "/var/opt/ignite/recovery/archives/nonprod".
bdf has a "feature" where it splits long lines into two, so unless you make sure that the number of fields is 6, you'll have to read the next line.
Or use Bill's bdfmegs:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2015 11:32 AM
04-07-2015 11:32 AM
Re: grep file system percentage above 60 %
Maybe you limit the output to 5 positions, so the awk filter just shows a limited number of 5 directories, even if the directory "/var/opt/ignite/recovery/archives/nonprod" was greater then 65%, but it is out of range...
regards
http://renatomartini.net
http://www.iti.gov.br
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2015 06:50 PM
04-07-2015 06:50 PM
Re: grep file system percentage above 60%
bdf is very awkward to use due to split lines.
Here is a function that will always return one line for every mountpoint:
function echoBDF1liners { bdf 2>/dev/null | while read FS TOT USED AVAIL PERCENT MNT do if [ $FS != "Filesystem" ] # skip header then if [ "$TOT" = "" ] # check for split lines then read TOT USED AVAIL PERCENT MNT fi echo $FS $TOT $USED $AVAIL $PERCENT $MNT # single line result fi done return }
Just call this function to return bdf output all on one line.
Bill Hassell, sysadmin