HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Snapshot of file permissions (script)
Operating System - HP-UX
1833873
Members
2953
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
01-14-2004 10:25 AM
01-14-2004 10:25 AM
I would like to generate a script to capture the current state of file ownership and permissions in a manner that I could restore the permissions in the event of a problem with a -R update. I think I can get 95% of the states, but there are some that cannot be reaserted in octal. I have found some clever things on the net, but nothing that would take and ls -l listing and turn it into chmod symbolic notation. Anyone done this before?
Thanks,
:-Dan
Thanks,
:-Dan
Did you check the Logs?
Solved! Go to Solution.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 12:07 PM
01-14-2004 12:07 PM
Solution
Actually there are no attributes that cannot be set using octal representation -- including sticky, setuid, and setgid bits. The same applies for numeric user/group ID's. I'd much rather have them than those mamby-pamby symbolic representations. Real UNIX guys always use the octal.
The attached Perl script will list filename, low-order 12-bits of mode, file type, uid, and gid for each argument supplied.
The exception to this rule is changing the mode of a symbolic link. The only way to chmod a symbolic link is via the undocumented lchmod() system call. If you search the Forums for lchmod, you should be able to find a small C program to do that.
The attached Perl script will list filename, low-order 12-bits of mode, file type, uid, and gid for each argument supplied.
The exception to this rule is changing the mode of a symbolic link. The only way to chmod a symbolic link is via the undocumented lchmod() system call. If you search the Forums for lchmod, you should be able to find a small C program to do that.
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP