- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script help with pruning
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
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
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
тАО06-08-2009 09:49 AM
тАО06-08-2009 09:49 AM
I have the following code and I would like to exclude the nfs and mvfs file systems from the find command. Please advise.
case "$OSTYP" in
AIX) find / -name "/proc" -prune -o \
\( -fstype jfs -o -fstype jfs2 \) \
\( -nouser -o -nogroup\)
;;
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2009 10:16 AM
тАО06-08-2009 10:16 AM
Re: Script help with pruning
Frankly I find the 'prune' option of find() variable among different UNIX flavors and troublesome to specify. Consider something like this:
# find / \( ! -fstype nfs \) -o \( -nouser -o -nogroup \)|grep -Ev '/proc|/mvfs'
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2009 10:30 AM
тАО06-08-2009 10:30 AM
Re: Script help with pruning
More thoughts??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2009 10:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2009 10:47 AM
тАО06-08-2009 10:47 AM
Re: Script help with pruning
find / \( ! -fstype nfs \) -a \( -nouser -o -nogroup \) -print | xargs ls -ld |grep -Ev '/proc|/mvfs'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2009 10:56 AM
тАО06-08-2009 10:56 AM
Re: Script help with pruning
To count the files simply do:
# find / \( ! -fstype nfs \) -a \( -nouser -o -nogroup \) |grep -Ev '/proc|/mvfs'|wc -l
If you want a long-listing of the files, then:
# find / \( ! -fstype nfs \) -a \( -nouser -o -nogroup \) -exec ls -ld {} + | grep -Ev '/proc|/mvfs'
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2009 12:27 PM
тАО06-08-2009 12:27 PM
Re: Script help with pruning
in addition to JRFs solutiuon; I want to remember the grep-option '-c', which counts matches.
# find / \( ! -fstype nfs \) -a \( -nouser -o -nogroup \) |grep -Evc '/proc|/mvfs'
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2009 10:43 AM
тАО06-11-2009 10:43 AM
Re: Script help with pruning
find / \( ! -fstype nfs \) -a \( -nouser -o -nogroup \) -exec ls -ld {} + | grep -Ev '/proc|/mvfs'
is failing. Please help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2009 12:10 PM
тАО06-11-2009 12:10 PM
Re: Script help with pruning
is failing. Please help."
describe "failing". also note that the grep command noted should toss anything the that has /proc or /mvs in the name ...
like /a/proc or /b/mvs.......
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2009 12:14 PM
тАО06-11-2009 12:14 PM
Re: Script help with pruning
> Actually it is still trying to find the "mvfs" file system.
Now you are better off consulting IBM/AIX documentation. As I understand it, 'MVFS' stands for "Multi-Verion-File-System". It appears that these are mounted under the directory name '/view'. Hence all I can offer is to include or exclude this directory as we have discussed previously in this thread.
By the way, you ought to change your Formum name from "shell script" to a more suitable moniker that represents _you_.
Regards!
...JRF...