1833027 Members
2113 Online
110049 Solutions
New Discussion

Soft Links

 
SOLVED
Go to solution
Doug_85
Regular Advisor

Soft Links


HP-UX 11.0

After we migrated our K system to our new L2000 a complete copy of the old system was imported into the new L2000. This was done in case something failed on the new system files were easily accessible.

Since we no longer need the Ksystem directory on the L2000 we are in the process of removing it. The Ksystem directory contains soft links to live production data on the system. What's an easy way to remove all the softlinks without removing the live data files they are attached to and then completely romoving all the files in this directory.

Plan of Action
1. Already backed up Ksystem directory
2. Remove softlinks (waiting)
3. Remove all files under Ksystem directory (waiting)

To remove the directory using rm -r is not a problem but must ensure all softlinks are removed to ensure live data is not deleted.

I know swremove can remove soft links from the software depot without deleting original files but can it also remove soft links from other directories as well.


Thanks,
Doug
4 REPLIES 4
Leif Halvarsson_2
Honored Contributor
Solution

Re: Soft Links

Hi
Yes, you can remove the link only. To remove softlinks
find . -type l -exec rm {} \;
Patrick Wallek
Honored Contributor

Re: Soft Links

If you are concerned about the links, search for them first and then manually remove them.

# find /Ksystem_dir -type l

This will give you a list of all links in the Ksystem_dir and all its sub-directories. From there you can verify that you want to remove them and do so manually.
Devender Khatana
Honored Contributor

Re: Soft Links

Hi Doug,

When you remove a link the original file is not deleted. Allthough when changes are made to original file or any of the links file changes. So just take care before removing. See that the old files are not getting updated with the time stamp on them.

HTH,
Devender
Impossible itself mentions "I m possible"
Doug_85
Regular Advisor

Re: Soft Links

I went ahead and replaced "rm" with unlink. This was done to ensure only the link was deleted.

Thanks,
Doug