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?

link|improve this 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
feedback

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

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

2 Answers

up vote 2 down vote accepted

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

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

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/
link|improve this answer
Thanks for the needed modifiers. – shady Sep 2 '10 at 14:21
feedback

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