Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have files like this on my linux web server:

  • folder1/ <- main, this is where users of my page are led to
  • folder1/testing/ <- copy of folder1(without folder1/testing/) to modify and optimize without disturbing the main version.

How do I synchronize folder1/ with the contents of folder1/testing/, so that folder1/ looks like folder1/testing/?

share|improve this question
1  
Another job for rsync, but really you should be using a VCS. –  jordanm Mar 30 '13 at 18:17
    
Be more specific. Remember the question is not "Which program to use" but "How do I synchronize folder1/ with the contents of folder1/testing/, so that folder1/ looks like folder1/testing/?" –  Peter Weter Mar 30 '13 at 18:26
    
This was a comment and not an answer because I just gave an rsync example in the question before your question. –  jordanm Mar 30 '13 at 18:28
    
@jordanm true, but generally you don't want to develop on the master (read "deployed") version. VCS should be entirely confined to the testing subdirectory in this case (which should be completely outside of the deployed version, btw. –  peterph Mar 30 '13 at 19:37
add comment

1 Answer

Since you are mentioning ssh/putty I expect you have shell access to the box. The directory setup is slightly cumbersome, having the testing version outside of the master copy is better. Hence:

  1. move the testing directory outside of master

    mv folder1/testing folder1_testing
    
  2. move current master version elsewhere - note that at this point the web becomes inaccessible until you get to the next step

    mv folder1 folder1_saved
    
  3. copy the previously testing version to the proper location

    cp -a folder1_testing folder1
    
  4. if you are unable to solve this in a different manner, symlink the testing version to the previous place to be able it access it via web at the same place:

    ln -vs folder1_testing folder1/testing
    
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.