2

I have a folder with the following contents. I am wanting to change the symbolic link in a single atomic transaction without deleting it.

drwxr-xr-x 9 root root 4096 Apr 10 13:47 2012-03-19
drwxr-xr-x 9 root root 4096 Apr 10 13:44 2012-04-10
lrwxrwxrwx 1 root root   10 Mar 19 15:28 current -> 2012-03-19

I figured out at one time that the following would do it:

# ln -sf 2012-04-10 current

However, it doesn't take. Any help is greatly appreciated!

FriendlyDev
  • 135
  • 5
  • atomic transaction on a file system?! – pfo Apr 10 '12 at 19:00
  • do an ls of current, I bet you will find your symbolic link there. – Zoredache Apr 10 '12 at 19:02
  • pfo: Sorry for using the wrong terminology. I've got a stronger database background and that was the best way I could think of to communicate my point quickly. I figured you would understand what I meant even if the terminology wasn't correct. Thanks! :) – FriendlyDev Apr 10 '12 at 19:08

1 Answers1

5

try the following

ln -sfn 2012-04-10 current

The reason

   -n, --no-dereference
          treat destination that is a symlink to a directory as if it were a normal file
Mike
  • 22,310
  • 7
  • 56
  • 79