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? I'm not sure that the --backup and --backup-dir options to rsync will give me exactly what I want. thanks, Thomas -- N.J. Thomas njt@ayvali.org Etiamsi occiderit me, in ipso sperabo
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 "d.sh" that will convert a given foo into a fooprime by reading "d". To convert a foo, just run "d.sh". 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@verizon.net -- http://mysite.verizon.net/hashproduct/
* Matt McCutchen <hashproduct@verizon.net> [2006-01-17 13:42:15 -0500]:> On Tue, 2006-01-17 at 00:06 -0500, N.J. Thomas wrote: > > 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 > > Yes. Run: > rsync <options> --only-write-batch=d fooprime/ foo/Excellent, this is exactly what I was looking for.> You may want to generate two batch files, one that converts foo to > fooprime and one that converts fooprime to foo.No need for now, I just needed something that goes in at least one direction. thanks, Thomas -- N.J. Thomas njt@ayvali.org Etiamsi occiderit me, in ipso sperabo