I posted the below question to stackoverflow, but people suggest I posted here instead:
I have two directories, dirA
and dirB
. I want to move everything in dirB
that are different from dirA
(checksum different, not mod-times) to a new directory dirC.
I am looking at rsync -c
command, but it seems like rsync
can only copy from one directory to the other, instead of compare and then copy to a new directory.
I can also write a long script that uses diff -qr
to get the file names and then analyze the output and copy out the files accordingly, but I really want to avoid parsing anything (that's where things need testing and debugging).
How can that be done reliably?