Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question
    
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
add comment

1 Answer

up vote 4 down vote accepted

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.