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 2 folders:

/home/sphinx/articlesdb/

and:

/home/sphinx/tmp/articlesdb/

I want to move and overwrite all of the files from tmp into the main folder.

I am currently using:

mv -f /home/sphinx/tmp/articlesdb/ /home/sphinx/

But I get this error:

mv: cannot move `/home/sphinx/tmp/articlesdb/' to a subdirectory of itself, `/home/sphinx/articlesdb'

It needs to do this as fast as possible so I don't want to copy.

Should I remove /home/sphinx/articlesdb/ completely and then run the mv command or do I just need to tweak the command slightly?

share|improve this question
    
Are there any linked folders involved here? –  Chris S Mar 15 '11 at 15:36
    
no i dont think so –  fire Mar 15 '11 at 15:37

2 Answers 2

What happens if you ensure that /home/sphinx/articlesdb is empty, then do

cd /home/sphinx/tmp/articlesdb
mv * /home/sphinx/articlesdb/
share|improve this answer
    
Or if you go to /home/sphinx/tmp and do mv articlesdb /home/sphinx/. –  Massimo Mar 16 '11 at 11:59

Decided to delete the original folder and then move it from tmp.

share|improve this answer
    
Glad you resolved [or created a work around for] this issue. Please be sure to mark your answer as "accepted" when you are able. –  jscott Jul 24 '12 at 23:34

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.