- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Retrive the 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
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
тАО07-07-2010 10:13 PM
тАО07-07-2010 10:13 PM
Re: Retrive the permissions
Is it possible take permissions back-up of all the files under the directory in octal format before running the chmod in recursive mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2010 10:47 PM
тАО07-07-2010 10:47 PM
Re: Retrive the permissions
Have you looked at my scripts? They don't use the obsolescent octal format but use a symbolic format, which is the preferred format for chmod(1).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2010 11:35 PM
тАО07-07-2010 11:35 PM
Re: Retrive the permissions
> Is it possible take permissions back-up of all the files under the directory in octal format before running the chmod in recursive mode.
- permission backup you can take with just:
#DATE="`date +%H%M.%m%d%y`" ; DIR="/oracle_pub"
# find $DIR -xdev -exec ls -l {} \; > all_file_dir_details.$DATE.txt
- The .txt file can be followed anytime you have problem finding any file/directory permission or ownership problem. And you can set it with chown and chmod command.
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2010 11:53 PM
тАО07-07-2010 11:53 PM
Re: Retrive the permissions
Yes but you really want a script to handle the zillions of bad files.
>find ... -exec ls -l {} \;
By using "+" instead of "\;" you can make it much faster. And you need to add "-d" so you don't list files twice:
-exec ls -l -d {} +
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2010 01:04 AM
тАО07-08-2010 01:04 AM
Re: Retrive the permissions
And ofcourse a script can only help to fix zillions of files..,
Regards,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2010 01:26 AM
тАО07-08-2010 01:26 AM
Re: Retrive the permissions
Check out the script attached to save current permisions in both numeric and -rwx format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2010 01:37 AM
тАО07-08-2010 01:37 AM
Re: Retrive the permissions
Check out the script (getperms) attached here ,to display/save current permisions in both octal and -rwx format.
(pls ignore the earlier post, missed the file):
output:
# ./getperms /etc
OK
755 drwxr-xr-x /etc
755 drwxr-xr-x /etc/initramfs-tools
644 -rw-r--r-- /etc/initramfs-tools/modules
755 drwxr-xr-x /etc/initramfs-tools/conf.d
644 -rw-r--r-- /etc/initramfs-tools/conf.d/resume
644 -rw-r--r-- /etc/initramfs-tools/update-initramfs.conf
644 -rw-r--r-- /etc/initramfs-tools/initramfs.conf
755 drwxr-xr-x /etc/initramfs-tools/hooks
755 drwxr-xr-x /etc/initramfs-tools/scripts
755 drwxr-xr-x /etc/initramfs-tools/scripts/init-bottom
755 drwxr-xr-x /etc/initramfs-tools/scripts/local-top
---------------------------------------------
Hth,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2010 06:23 PM
тАО07-09-2010 06:23 PM
Re: Retrive the permissions
I will check and update ASAP.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2010 09:20 PM
тАО07-09-2010 09:20 PM
Re: Retrive the permissions
I ran the Script, but the all the permissions saved "000" format.Please look in to the attached file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-10-2010 12:21 AM
тАО07-10-2010 12:21 AM
Re: Retrive the permissions
The latest version attached here with, check it out, hope this will fix the problem: fine,
# Usage :
# ./getperms /path
or
# ./getperms .
---------------------------
Example:
########
$ ./getperms /var/tmp
OK
776 drwxrwxrwt root:root /var/tmp
555 dr-xr-xr-x root:root /var/tmp/bgpd
755 drwxr-xr-x root:sys /var/tmp/hsperfdata_root
555 dr-xr-xr-x root:root /var/tmp/isisd
555 dr-xr-xr-x bin:bin /var/tmp/ntp
555 dr-xr-xr-x root:root /var/tmp/ramd
555 dr-xr-xr-x root:root /var/tmp/ripngd
$
$ ls -l /var/tmp
total 0
dr-xr-xr-x 2 root root 96 Jun 12 12:45 bgpd
drwxr-xr-x 2 root sys 96 Jun 27 23:57 hsperfdata_root
dr-xr-xr-x 2 root root 96 Jun 12 12:45 isisd
dr-xr-xr-x 2 bin bin 96 Jun 12 12:13 ntp
dr-xr-xr-x 2 root root 96 Jun 12 12:45 ramd
dr-xr-xr-x 2 root root 96 Jun 12 12:45 ripngd
$
---------------------------------------------------------------------
Enjoy, Have fun!.,
Raj.