Operating System - HP-UX
1823986 Members
4024 Online
109667 Solutions
New Discussion юеВ

Backup and restore soft links / symbolic links

 
Rizwan Choudhry
Advisor

Backup and restore soft links / symbolic links

Hi there,
I am using HPUX 11.23.
Does any one know any easier way to backup and then restore symbolic links.
I have to change directory 169 symbolic links. which can be tiem consuming and boring task.

I am not if there is a file on the system which manages symbolic links, and which can be changed easily.

Thanks in advance.
rizzir
4 REPLIES 4
Fabio Ettore
Honored Contributor

Re: Backup and restore soft links / symbolic links

Hi,

Bill Hassell always posts interesting answers, about how to backup symbolic link I should refer to the following thread:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1206545161532+28353475&threadId=946532

fbackup should help, otherwise products like Data Protector keep the symbolic link.

HTH.

Best regards,
Fabio
WISH? IMPROVEMENT!
Rizwan Choudhry
Advisor

Re: Backup and restore soft links / symbolic links

Thanks Fabio for your help,
I was more interested in Changing the Soft links Path.
I have rename the oracle Database, which invloves changing some Database paths.

I simply wants to know if there is anyway i can edit existing soflinks to change the paths
for example.
From
/tmp/test1
To
/tmp/test2


Thanks
regards
riz
rizzir
Fabio Ettore
Honored Contributor

Re: Backup and restore soft links / symbolic links

Ok, sorry...now I understand better.
I don't think there is a file containing symbolic links but you can search for them by command 'find'. Follow some inputs to have an idea:

- to find symbolic link on the system:
find . -type l

l is for symbolic link (see man find)

- to find symbolic link named test1:
find . -type l -name test1

- to find symbolic link with name test1 and rename them to test2:
find . -type l -name test1 -exec mv {} test2 \;

Hope this helps you.

Best regards,
Fabio
WISH? IMPROVEMENT!
Dennis Handly
Acclaimed Contributor

Re: Backup and restore soft links / symbolic links

>backup and then restore symbolic links.

(You want to change them, not backup/restore. Your thread subject is confusing.)

>if there is anyway i can edit existing softlinks to change the paths
>From: /tmp/test1, To /tmp/test2

The simplest way is to create a link from test1 to test2.

Otherwise you should spend your time on creating a script to do all of them at once.

I assume you want to change any symlink that points to target1 to target2?
And that this path can be anywhere in the link?
You should do ll(1) on one link you want to change so we can see the pattern.

>Fabio: find . -type l -name test1 -exec mv {} test2 \;

This will change the source of the link and not the target.
Basically a rm then ln -s needs to be done.