Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
Linux equivalent to robocopy?

I have two websites - one is basically a development version and the other is a production version of the same site. So I'd like to be able to merge the changes made to the development site based on the modified date of the files. Is this possible with the 'cp' command?

share|improve this question

marked as duplicate by Doug Harris, Sathya, random Sep 2 '10 at 17:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Even if you don't know what robocopy is on windows, you should look at the answer on that question about rsync. rsync is the tool you want. –  Doug Harris Sep 2 '10 at 13:30
    
@Doug -- why not submit an answer, rather than a comment to the question? –  JoelFan Sep 2 '10 at 13:38
1  
@JoelFan -- because I voted to close this question as a duplicate. It's bad form to post an answer which can get points on a question one has voted to close. –  Doug Harris Sep 2 '10 at 13:43
    
I searched for an answer to this question before I placed this question and did not find a suitable answer. I'm sorry if I didn't search deep enough. –  shady Sep 2 '10 at 13:51
    
no worries. That other question's title has an assumption that one knows what robocopy is and thinks of that first. Now that you've added this question, future readers will find this with a pointer to the other. –  Doug Harris Sep 2 '10 at 14:05

2 Answers 2

up vote 5 down vote accepted

Use rsync -- here's some info -- http://www.samba.org/ftp/rsync/rsync.html

share|improve this answer
9  
I also found that cp -u copies only updated files. –  shady Sep 2 '10 at 14:20

As JoelFan advised, rsync would most likely be the tool you seek. If you can't go with the full blown rsync client/server setup, it works just as well over ssh.

An rsync over ssh example:

rsync -cavzu /some/dirs/and/files user@host:/some/destination/
share|improve this answer
    
Thanks for the needed modifiers. –  shady Sep 2 '10 at 14:21

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