- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to change perms for read only on all directori...
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
тАО12-14-2010 10:03 AM
тАО12-14-2010 10:03 AM
The problem is everytime the app is recycled it changes the perms on all subdirectory to 740 starting with /app/weblogic10 and users are denied access.
How can I change OTHERS perms to rx on all subdirectories starting from /app/weblogic10. ? I am thinking cron every hour but do I need to chmod 755 on each subdirectory ?
Thanks
#cd /app/weblogic10/10.3.3.0/user_projects/domains/cgsqa/servers/AdminServer/tmp/_WL_user/vip/5myxvs/war/locallogs/app.log
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 10:12 AM
тАО12-14-2010 10:12 AM
Re: How to change perms for read only on all directories/sub-directories ?
You could do:
# find /app/weblogic10 -exec chmod g+rw,o+rw {} +
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 10:14 AM
тАО12-14-2010 10:14 AM
Re: How to change perms for read only on all directories/sub-directories ?
Thannks . That may work. But , I just want the directories (not files) and I only want the subdirectories in the path below.
/app/weblogic10/10.3.3.0/user_projects/domains/cgsqa/servers/AdminServer/tmp/_WL_user/vip/5myxvs/war/locallogs/app.log
I dont want all subdirectoreis under /app/weblogic10.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 11:24 AM
тАО12-14-2010 11:24 AM
Re: How to change perms for read only on all directories/sub-directories ?
If you want only directories use -type d with the find command. You lookin' for subdirectories appropriately use the wildcard "*". Hope info helps.
Regards
Ismail Azad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 12:58 PM
тАО12-14-2010 12:58 PM
Solution> I just want the directories (not files) and I only want the subdirectories in the path below.
OK, I think I misunderstood. You want to alter the permissions on the file at the base of the path and all of the difrectory hierarchy:
# cat ./myfix
#!/bin/sh
MYPATH=/app/weblogic10/10.3.3.0/user_projects/domains/cgsqa/servers/AdminServer/tmp/_WL_user/vip/5myxvs/war/locallogs/app.log
while [ "${#MYPATH}" -gt 1 ]
do
echo chmod g+rw,o+rw ${MYPATH}
MYPATH=$(dirname ${MYPATH})
done
...when you are satisfied with the results that this would give, remove the 'echo'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 01:13 PM
тАО12-14-2010 01:13 PM
Re: How to change perms for read only on all directories/sub-directories ?
Then just pass that to JRF's find. Or cd to that directory and use "find . ...".
>JRF: find /app/weblogic10 -exec chmod g+rw,o+rw {} +
If you want to add rx, change to:
find . -type d -exec chmod go+rx {} +
>Ismail: You looking for subdirectories appropriately use the wildcard "*".
find(1) will find directories without that "*".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 01:16 PM
тАО12-14-2010 01:16 PM
Re: How to change perms for read only on all directories/sub-directories ?
satified with the results and also with your perfect response. For my sake, could you just tell me what this line does.
while [ "${#MYPATH}" -gt 1 ]
Thanks a bunch. A perfect 10 answer. JRF.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 02:03 PM
тАО12-14-2010 02:03 PM
Re: How to change perms for read only on all directories/sub-directories ?
> could you just tell me what this line does.
while [ "${#MYPATH}" -gt 1 ]
This begins a 'while...do' loop. The *length* of the value of MYPATH is tested to be greater than one (1). While this is true, the loop is entered. I chop away a subdirectory during each iteration and hence when I reach either a "/" or a "." I want to quit.
The manpages for 'sh-posix' under the section on parameter substitution document the length feature.
I should have generalized the script. Instead of hardcoding the path you want to operate upon, we could do:
# cat ./myfix
#!/bin/sh
MYPATH=$1
while [ "${#MYPATH}" -gt 1 ]
do
echo chmod g+rw,o+rw ${MYPATH}
MYPATH=$(dirname ${MYPATH})
done
...now run as:
# ./myfix /app/weblogic10/10.3.3.0/user_projects/domains/cgsqa/servers/AdminServer/tmp/_WL_user/vip/5myxvs/war/locallogs/app.log
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 02:19 PM
тАО12-14-2010 02:19 PM
Re: How to change perms for read only on all directories/sub-directories ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2010 08:39 AM
тАО12-22-2010 08:39 AM
Re: How to change perms for read only on all directories/sub-directories ?
Instead of using one path, i.e, , I want to use various paths in the script. How would I change script to do that in a loop. Since it will be run via cron, I want various path hardcoded in the file itself.
Like here, I want perms change in all these.
/usr/local/patha/pathb
/usr/local/pathc/pathd
/usr/local/pathe/pathf