Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Currently I use

rsync -avh --stats --progress dir1(source)say dir2(destination) ...

say I have 10 files in dir1 and I have copied using the above command to dir2 all 10 files.

Say now I have added another 5 files to dir1 and I want only the new 5 files and any updates to get copied to dir2 when I run rsync again. Can I use the above command and switches or should I modify it?

share|improve this question
up vote 4 down vote accepted

Generally, the same command used to copy a bounce of files with rsync could be used unmodified to update the destination directory every time the source directory change.

But the two directories do not become identical, because files deleted on the source are not deleted on the destination, if you don't ask explicitly for that. If you want that you would have to use additionally the parameter --delete.

share|improve this answer
I'd also add the -u flag to "skip files that are newer on the receiver". – roadmr Dec 26 '11 at 18:28
@enzotib thanks – joe1983 Dec 26 '11 at 22:45
now i have modified my rysnc as rsync -avh --progress --delete --stats --exclude-from=exclude.home dir1(source) dir2(destination) – joe1983 Dec 27 '11 at 0:14

Your Answer


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.