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?


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.

  • 1
    I'd also add the -u flag to "skip files that are newer on the receiver". – roadmr Dec 26 '11 at 18:28
  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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