Ubuntu: rsync between two directories


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.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »