[ProgSoc] Rsync via an intermediate medium

Nicholas FitzRoy-Dale wzdd at progsoc.org
Wed Dec 2 05:24:56 EST 2009


On 01/12/2009, at 4:06 PM, jedd wrote:

> I'm happy just for a way to identify the differences, as I
> can manually chuggle stuff back into the right place(s)
> at the target end later, that's no biggy.  A du -a output
> would kind of work - but it'd be massive, as this is a
> collection of files of 2-5mb in size.

Is this a one-time thing? Can you do something like:

dir1$ find . -type f -exec echo -n \{\} " " \; -exec shasum \{\} \; | sort >dir1.sha
dir2$ find . -type f -exec echo -n \{\} " " \; -exec shasum \{\} \; | sort >dir2.sha

$ diff -u dir1.sha dir2.sha |grep "^+[^+]"

This then at least gives you a list of files to do a binary diff on, or rsync, or whatever. Basically compare sha1sums. The complicated 'find' line is to make sure you get the filename first, so that 'sort' works.

If it's something that needs to be actually elegant / easy-to-automate / etc, then I got nothing.

Nicholas




More information about the Progsoc mailing list