- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Help on script to change permissions
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
09-19-2012 05:29 AM
09-19-2012 05:29 AM
Hi
I have written the following script that later I want to put in cron:
#!/bin/bash _find="/usr/bin/find" _paths="/moneta_polled01/mediation_gsm /moneta_polled01/mediation_mmsc" for d in $_paths do $_find $d -type f -exec chmod 777 {} \; done
but it does not seem to be working for the second subdirectory define on line 3.
Please can you help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2012 05:50 AM
09-19-2012 05:50 AM
Re: Help on script to change permissions
what is the error?
are you sure you have write access on dir and are owner of the files in /moneta_polled01/mediation_mmsc
else you could write
#!/bin/bash _find="/usr/bin/find" _paths="/moneta_polled01/mediation_gsm /moneta_polled01/mediation_mmsc" $_find $_paths -type f -exec chmod 777 {} \;
OR
$_find $_paths -type f |xargs chmod 777
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2012 06:15 AM
09-19-2012 06:15 AM
Re: Help on script to change permissions
I am running as root.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2012 07:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2012 08:14 AM
09-19-2012 08:14 AM
Re: Help on script to change permissions
Hi,
I think the script is running fine, the problem is, there are files arriving every minute or so on those directories, so sometimes the script finishes to run, but some files did not get the permission changed because files are arriving all the time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2012 08:21 AM
09-19-2012 08:21 AM
Re: Help on script to change permissions
That would make perfect sense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2012 11:04 AM
09-19-2012 11:04 AM
Re: Help on script to change permissions
You can speed this up by changing the find to:
$_find $d -type f -exec chmod 777 {} +