#! /bin/sh # this test is a bit easier than test11 since the file size differs . ${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 echo baz >> 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 echo baz >> 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. $rsync -a --ignore-times dir1/ dir3 compare_trees dir2 dir3