1

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?

  • 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. – slim Sep 2 '10 at 13:51
  • 1
    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
5

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

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

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/
| improve this answer | |

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