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 ln -n -f -s / arf
...
symlink("/", "arf") = -1 EEXIST (File exists)
unlink("arf") = 0
symlink("/", "arf") = 0
strace Without -n
:
strace ln -f -s / arf
...
write(2, "ln: "..., 4ln: ) = 4
write(2, "`arf/': cannot overwrite director"..., 34`arf/': cannot overwrite directory) = 34
write(2, "\n"..., 1) = 1
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.
Best Answer
You can create a symbolic link with the command line utility
mklink
.Symbolic links via mklink are available since Windows Vista and Windows Server 2008. On Windows XP and Windows Server 2003 you can use
According to msdn.microsoft, Symbolic Links are NOT supported on FAT16/32 and exFAT. It seems Windows only supports them from or to NTFS-Partitions. Future Windows operating systems are likely to continue support for mklink.
You can read further information about this new feature on Microsoft TechNet, Junfeng Zhang's blog or howtogeek.com.