getting "diff" of directory trees

Matt McCutchen hashproduct at
Tue Jan 17 18:42:15 GMT 2006

On Tue, 2006-01-17 at 00:06 -0500, N.J. Thomas wrote:
> Given two directories "foo" and "fooprime", can I have rsync make a file
> or directory "d", that contains the differences between these two
> directories such that I can take d and apply it to foo to get fooprime,
> or take fooprime and reverse-apply d to it to get foo?

Yes.  Run:
	rsync <options> --only-write-batch=d fooprime/ foo/
That will generate an rsync batch file called "d" containing the
necessary information to turn a foo into a fooprime and a shell script
"" that will convert a given foo into a fooprime by reading "d".  To
convert a foo, just run "".

Batch files are one way, however: they include the actual data that is
added or written at the destination and an indication of what data is
deleted or replaced, but not the actual data that is deleted or
replaced,  You may want to generate two batch files, one that converts
foo to fooprime and one that converts fooprime to foo.
Matt McCutchen, ``hashproduct''
hashproduct at --

More information about the rsync mailing list