Operating System - HP-UX
1748359 Members
5122 Online
108763 Solutions
New Discussion юеВ

Re: Retrive the permissions

 
SOLVED
Go to solution
Anoop Sivan
Frequent Advisor

Retrive the permissions

Hi Team

Is there any way to retive the old permissions of all the Files under /oracle_pub.

[xxtredg51:/]#chmod -R 755 /oracle_pub


22 REPLIES 22
Kapil Jha
Honored Contributor

Re: Retrive the permissions

>[xxtredg51:/]#chmod -R 755 /oracle_pub

are you asking or telling the answer.

well there is no way to recover the permission.

You can on the other hand fix the permission of root file system (almost all) with swverify.

There is nothing you can do to oracle_pub, other than restore or if you know the permission earlier.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Anoop Sivan
Frequent Advisor

Re: Retrive the permissions

Thanks for your reply

looking for some answers....
Patrick Wallek
Honored Contributor

Re: Retrive the permissions

You could possibly consult your backups. If you backup software allows you to browse and look at file ownership and permissions, that could be one way.

If not, you could try restoring from your backup to a different directory, or different server, and then look at the files that were restored to see their ownership and permissions.
Anoop Sivan
Frequent Advisor

Re: Retrive the permissions

Is there any option to took the permission back up of all the files under the /oracle_pub directory before running the "chmod -R" command. So that in future we can avoid these type of outages.
Kapil Jha
Honored Contributor

Re: Retrive the permissions

First
there is no magic for the issue you have.

Second
the only way to have permission backup is run

ls -lRt /oracle_pub > your_backup

Third,
I hope I have not provided the answer again
so 0 point again :)

BR,
Kapil+





I am in this small bowl, I wane see the real world......
johnsonpk
Honored Contributor
Solution

Re: Retrive the permissions

Hi Anoop,

execute this comand before the permission change

find /oracle_pub -exec ls -ld {} \; |awk '{print $1,$3,$4,$9}' >> /tmp/file_dir_permission

the above command will create a file named "file_dir_permission" on /tmp and the contents will look like below

-rw-r--r-- root sys /tmp/unzip-6.0-ia64-11.31.depot
drwxr-xr-x root sys /tmp/mars_backup
-rw------- hpsmdb users /tmp/.s.PGSQL.50006.lock
srwxrwxrwx hpsmdb users /tmp/.s.PGSQL.50006
-rw-r--r-- root sys /tmp/iSCSI-00_B.11.31.03_HP-UX_B.11.31_IA_PA.depot


Regards!
Johnson
Raj D.
Honored Contributor

Re: Retrive the permissions

Anoop,

-If you have previous output of the /oracle_pub directory ( like # find . -type f -exec ls -l {} \; > oracle_pub_orig_files.list ) , you can check and reset the permissions to it's original values.

- Also if you have backup (netbackup or Dataprotector backing up the data) you can restore it on a different directory and retrive the old permissions.


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Dennis Handly
Acclaimed Contributor

Re: Retrive the permissions

>Is there any option to take the permission backup of all the files under the /oracle_pub directory

You could use my scripts in this thread:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1215123

One will save the info and the other will restore them.
Anoop Sivan
Frequent Advisor

Re: Retrive the permissions

Thanku very much Johnson/Raj/Dennis for your timely promt reply. I will check and reply Immediately....