Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Windows has a nice option to its XCOPY command: /D. This copies only files where the source modification time is newer than the destination time. Is there any unix/linux equivalent of this? I'm trying to get a fast copy to my local testing server.

share|improve this question

migrated from Nov 5 '09 at 21:36

This question came from our site for professional and enthusiast programmers.

This should be asked on SuperUser as it has nothing to do with programming. – SLaks Nov 5 '09 at 21:34
up vote 6 down vote accepted

I usually do:

rsync -avz /from/where/ /to/dest/

If you want it to delete files that doesn't exist anymore in /from/where add --delete.

It can also be used from different boxes like this:

rsync -avz
share|improve this answer
Normally I'd add "-e ssh" to that last one. I don't like running an rsync server because it's not secure enough. – Paul Tomblin Nov 5 '09 at 21:40
I was under the impressions that rsync uses ssh by default. I think you need two colons to specify an rsync server. – Ryan Thompson Nov 5 '09 at 22:39
Oh yeah, you might want to throw in the --update option, if you don't want to overwrite newer files in the destination, but only older ones. It depends on whether you just want to efficientlysynchronize the two directories, or you want the exact behavior described above, with modification times. – Ryan Thompson Nov 5 '09 at 22:51
Yeah, it uses ssh by default. Need to add more "options" for rsync. Funny huh? – Eduardo Romero Nov 5 '09 at 23:14
cp --update src dest

From the man page:

copy only when the SOURCE file is newer than the destination file or when the destination file is missing

share|improve this answer

My brain couldn't quite cope with the complexities of rsync so I installed Lucky Backup. This provides an easy to use graphical interface as a front end for rsync. When you've set up your copy/backup task, you can run it from the programme. You can also click on the "validate" button for the task and it will give you the full rsync command line such that you can run it in a terminal or paste it into a shell script. It's a nice tool for teaching the use of rsync.

Screen Shot of Lucky Backup

Clicking on the "Advanced" button in the "Task Properties" window gives access to some of rsync's features.

share|improve this answer
Can you expand upon your answer with some screenshots? Your answer reads a bit like spam. – bwDraco Apr 7 '15 at 16:31
I tried to add a screenshot but the system demanded I had at least 10 reputations! I have added a link instead. – Gannet Apr 11 '15 at 20:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .