#! /bin/sh . ${tstdir-.}/lib.sh . ${tstdir-.}/conf.sh umask 022 rm -rf dir1 dir2 dir3 # make the copy-from-here tree mkdir dir1 cd dir1 generate_tree_1 rm foo/baz/three.txt # make this file again the way we want it. dd if=/dev/zero bs=1m count=1 status=none > foo/bar/baz/one.txt echo foo >> foo/bar/baz/one.txt dd if=/dev/zero bs=1m count=1 status=none >> foo/bar/baz/one.txt # make the tree we want to compare to mkdir ../dir2 cd ../dir2 generate_tree_1 rm foo/baz/three.txt # make this file again the way we want it. dd if=/dev/zero bs=1m count=1 status=none > foo/bar/baz/one.txt echo foo >> foo/bar/baz/one.txt dd if=/dev/zero bs=1m count=1 status=none >> foo/bar/baz/one.txt mkdir ../dir3 cd ../dir3 generate_tree_1 rm foo/baz/three.txt # make this file different in the middle dd if=/dev/zero bs=1m count=1 status=none > foo/bar/baz/one.txt echo bar >> foo/bar/baz/one.txt dd if=/dev/zero bs=1m count=1 status=none >> foo/bar/baz/one.txt cd .. # openrsync needs the --ignore-times here since it doesn't have # a flag to force checksumming. echo $rsync -a --ignore-times dir1/ dir3 $rsync --rsync-path openrsync -a --ignore-times dir1/ dir3 compare_trees dir2 dir3