- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Need a Script help
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
тАО09-15-2005 05:41 AM
тАО09-15-2005 05:41 AM
I inherited a script that runs on all the unix servers. It checks for suid changes and sends a report.
Now on AIX servers i want to EXCLUDE the /proc directory.
So if the server is AIX exclude /Proc.
Can you please suggest what modification needs to be done?..Attached is the existing script
Any help will be welcome
regards
George
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2005 05:53 AM
тАО09-15-2005 05:53 AM
Re: Need a Script help
find /
Change it to a list of all the mounted file systems except /Proc:
find /usr /etc /home /var
and so on.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2005 05:55 AM
тАО09-15-2005 05:55 AM
Re: Need a Script help
I would like to check if OS=AIX then just exclude /proc.
thanks
George
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2005 05:58 AM
тАО09-15-2005 05:58 AM
Re: Need a Script help
No time for coding examples right now. If I get time later, I can work on it. Someone else will probably have an example for you though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2005 06:02 AM
тАО09-15-2005 06:02 AM
Re: Need a Script help
this will give you HPUX output (in capital letters) if executed on an hpux system. Run it on AIX machine and see what it generates and construct an "if" logic around the strings after your case statement block is executed.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2005 06:03 AM
тАО09-15-2005 06:03 AM
Re: Need a Script help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2005 06:03 AM
тАО09-15-2005 06:03 AM
Re: Need a Script help
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2005 06:04 AM
тАО09-15-2005 06:04 AM
Re: Need a Script help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2005 07:34 AM
тАО09-15-2005 07:34 AM
Re: Need a Script help
Use find()s '-prune'. Consider a case where you would want to find all files named "core*" [without being careful of what was returned :-)) ] and want to do that from the root directory, for every mountpoint there under, *except* /usr.
This syntax works on HP-UX or AIX so you can adapt it to your needs. In fact, since HP-UX doesn't have a /proc directory you can probably unconditionally factor this into your 'find' command regardless of the OS.
By example:
# find / -name usr -prune -o \( -type f -a -name "core*" -a -print \)
...this returns all files named "core*" from all directories *except* 'usr'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2005 08:10 AM
тАО09-15-2005 08:10 AM
SolutionYou could try the following.
NOTE: I don't have AIX machine. was not tested.
##################################################################################################
find_all_suid_FILES()
{
OSTYPE=`uname -s`
if [ ${OSTYPE} = "HP-UX" -o ${OSTYPE} = "AIX" ]
then
find / -type f -a \( -perm -u+s -o -perm -g+s \) -exec ls -dl {} \; | \
sort -k 3,3 -k 9,9 -k 4,4 > ${WORK_FILE} # Sort by user, group, and file
elif [ ${OSTYPE} = "AIX" ]
then
find / -type f -a \( -perm -u+s -o -perm -g+s \) -exec ls -dl {} \; | \
sort -k 3,3 -k 9,9 -k 4,4 | grep -v /proc > ${WORK_FILE} # Sort by user, group, and file
fi
}
#################################################################################################
-Junior