- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Regarding copying links
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
Forums
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
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
02-08-2005 11:41 PM
02-08-2005 11:41 PM
when i am copying some link from one directory to another, i can see it is simply coying it, i mean to say suppose in one directory i have links like file -> ../../file then using command "cp -r" i am trying it to copy into some location and then when i am executing
" ls -l " at copied location it is simply showing file -> ../../file which has no meaning for copied location(IT IS NOT COPYING ACTUAL CONTENT)
I will be greatful to listen any reponse on this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2005 12:43 AM
02-09-2005 12:43 AM
SolutionYou should really use the absolute path of the target file when creating a link.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2005 12:46 AM
02-09-2005 12:46 AM
Re: Regarding copying links
if the link has been created with a relative path i.e. ../../file , then copying the link will not change the pointer of the link. So the relative path will be maintained.
Same as creating a ln -s to a file and then moving that target file will not move your link pointer.
All I can suggest is recreating the link with absolute paths i.e. /
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2005 12:58 AM
02-09-2005 12:58 AM
Re: Regarding copying links
We are able to copy content of link on solaris using sme command " cp -R "
Is there any other option or way in which we can attain same behaviour on hp .
Seeking for ur immediate help ,
Thanks ,
varun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2005 01:16 AM
02-09-2005 01:16 AM
Re: Regarding copying links
If the location of the target file changes depending on the platform , then you could try setting an environment variable with the absolute path of the application's home directory, and create the link using that. e.g.
in .profile:
export APPDIR=/path/to/application
Then create the link with:
ln -s ${APPDIR}/bin/application_exe ./application_exe
You could then copy that symbolic link to anywhere on that machine, and it would still point to the relevant file. You could use the same variable (with a different path) and the same ln command to create a similar link on another platform, and it would work there, but the symbolic links could not be copied between platforms.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2005 01:25 AM
02-09-2005 01:25 AM
Re: Regarding copying links
ln -fs file /full_path/file
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2005 01:37 AM
02-09-2005 01:37 AM
Re: Regarding copying links
Actually i dont have to create link..
i have to copy those files beacuse i have to give write permission for those file later on.
Can you suggest something else.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2005 08:44 AM
02-09-2005 08:44 AM
Re: Regarding copying links
instead of using "cp" use rcp across the servers - this will always copy content instead of the actual link itself. The reason I know this is b/c I am always *wanting* the link and not what the link is pointing to. Basically, the opposite problem you have. So, I have to use tar instead rcp.
Anyways, set up remote shell across the two servers so that they work using .rhosts files.
To get the files onto HP server from the Sun Server... (logged onto the HP server).
rcp -rp sunbox:/disk1/stuff_i_want/ /disk1/stuff_i_want/
This should deliver to you all of your files sans symbolic links (with actual files instead).
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2005 06:41 PM
02-09-2005 06:41 PM
Re: Regarding copying links
U can use tar for the same.
1) tar -cvf
2)copy the tar file to the other sun server
3)extract the same
tar -xvf
Hope this helps
Rgds
suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2005 07:41 PM
02-09-2005 07:41 PM
Re: Regarding copying links
That i am doing , Actually for that tarcvf will not solve our purpose but "tar -cvhf" will do that, but i was actually interested in knowing any option available with cp.
Thanks for your suggestion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2005 03:35 AM
02-10-2005 03:35 AM
Re: Regarding copying links
find . -follow -depth -print |cpio -pdmh /usr/tmpi/tmp1
The above copies the data in the current directory (that contains symbolic links) to new temporary location populating it with the source files files (no links)
To transfer a directory tree to another system:
find . -follow -depth -print |cpio -oh > /tmp/file.out
then transfer file.out to the new location
from the destination directory use
cpio -idm < file.out
Your plan seems reasonable. You might have some problems, If your source directory tree has several symbolic links to the same source file. Transfering your data to the new system might cause data syncronation problems. Where a future file change updates one and not the other. Symbolic links solve this problem. My advice is do "find . -type l -print" , to see if you have some several links pointing to the same data. If you do, after the move, it should be simple enough to true up the few files you might find.
Good Luck
Rory