I'm using
ln -f -s
/var/www/html/releases/build1390
app-current
to update symbolic link "app-current" with a new destination.
However, this doesn't work, the link "app-current" keeps it original destination, however, I don't get any errors…
I'd rather not remove the link and recreate it, just update the target of an existing link. Is that possible?
Best Answer
That works for me, what is the output of
strace ln -f -s /var/www/html/releases/build1390 app-current
?Oh, since it is a directory you need to add
-n
for no dereference and this should solve the issue.-f
is really more of a convenience since adding the -f just causes it to unlink anyways. Although I guess it would probably happen a few hundred ms faster on a normally loaded system.For example, if arf already points to /home:
strace With
-n
:strace Without
-n
:So without the
-n
arf gets dereferenced so ln treats it as arf as if it were actually/
. In your particular example, if there is no error, I think you have probably created a new symbolic link inside of/var/www/html/releases/build1390 app-current
and will want to clean that up.