Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.