Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

removed /usr/bin folder 1

Status
Not open for further replies.

murali2104

Technical User
Jul 6, 2005
43
IN
On HP-UX 11.11, I have mistakenly removed /usr/bin folder. Later I am able to FTP the contents from another HP machine to /usr/bin folder; But there are no exec permissions. (chmod also is a part of /usr/bin which do not have exec permissions)

Is there any out?
 
A backup perhaps? How did you ftp the files - I wonder whether permissions would be preserved if you tarred /usr/bin on the source machine, ftp the tar file, then untar it on the target.
 
Hello,

a few ideas:

First, I agree with Ken: The best way would be a restore from backup, if available.
And the next best seems to be the tar method.
But ...
tar is /usr/bin/tar, and so it may be not available, or it may not have exec permissions either...

Can you try rcp or scp? -p flag should preserve permissions.

An if all this fails: There is a trick that will allow you to ftp your chmod file with exec permissions:
For this you will need, on your target machine, some file that already has exec permissions, and that you don't need any more, and so you may overwrite it. Lets say its name is /path/oldprogram.
ftp /usr/bin/chmod to /path/oldprogram, then /path/oldprogram will still have exec permissions, and the contents will be chmod.
Then you may do a /path/oldprogram 777 my_files .

hope this helps
 
Another way: make an ignite backup on the working machine and restore it (but only /usr/bin) to the broken machine, either with tapes or via the network.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top