0
1
I have two directories on my Linux system that I want to sync. Most of the contents of these directories are the same, however some files differ:
Directory A contains:
File 1
File 2
File 4
File 5
Directory B contains:
File 1
File 2
File 3
File 5
After synchronization, I want both directory A and directory B to contain:
File 1
File 2
File 3
File 4
File 5
This is an example, the real directories contain thousands of files and their size is several GBs.
How can I do this on Linux?
Update: What if File 1, 2, 4, 5 are not in directory A but in a subdirectory AA that is in directory A? The files in directory B remain the same. After syncing, I don't want to end up with multiple copies of File 1, 2, 5.
rsync
, making sure you don't use--delete
? – dirkt – 2017-07-16T10:49:44.643