[lug] rsync to explore file system differences?

Quentin Hartman qhartman at gmail.com
Wed Feb 4 18:01:22 MST 2015


I would write a shell script around "diff --brief --text --recursive
--new-file "$OLD_FS" "$NEW_FS""

Save that output into a variable then pipe into a "while read" loop, and
you can do different things with each line depending on what the status is.

On Wed, Feb 4, 2015 at 4:19 PM, <stimits at comcast.net> wrote:

> I'm working with an application which creates a linux installation via a
> copy of an existing file system, but it then updates this dependent upon
> boot loader choices and installation choices. So basically there is a
> reference root file system, plus a derived root file system. The derived
> and original file systems are both available on the same computer at the
> same time. I wanted to do some testing to see any changes introduced by the
> program, along with validating that the file content has not changed.
>
> Method 1 to do this would be to use something like find, ls, and sha1sum
> on every single file and directory, comparing between the two...this is a
> long and difficult way to do it.
>
> For method 2 I thought about letting rsync do this instead, as it has a
> "--dry-run" option. This would have some advantages, such as rsync already
> knowing about things like file dates and checksums without actually
> altering anything. The problem there is that it isn't working as expected.
> Without verbose mode rsync doesn't really say anything. With verbose mode
> it seems network details like bytes sent is mainly what rsync comments on.
> I've also had issues with verbose mode and --dry-run ending up telling me
> about things I don't want to know about, e.g., empty files which are
> otherwise exact on both sides (and yet I have not used any options to tell
> it to remove or ignore empty files/directories).
>
> So with manually going through every single file and directory on two
> essentially complete linux file systems not being particularly practical,
> and with rsync not providing the output I need while putting out other
> information I don't need, are there any other existing solutions to
> comparing two complete systems which are expected to match? Perhaps there
> are other utilities for backup and restore which could be used explore
> large directory tree differences?
>
> Thanks,
> D. Stimits, stimits AT comcast DOT net
>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20150204/2e3a2d6b/attachment.html>


More information about the LUG mailing list