3 # Test that src and dest trees are as identical as bup is capable of
4 # making them. For now, use rsync -niaHAX ...
11 Usage: compare-trees [-h] [-c] [-x] SOURCE DEST
16 Check file content (default)
18 Don't check file content (rely on size/timestamps, etc.)
22 verify_content=" --checksum"
24 while getopts "hc" OPTION
28 c) verify_content=" --checksum";;
29 x) verify_content="";;
30 ?) usage 1>&2; exit 1;;
34 shift $(($OPTIND - 1))
46 trap "rm -rf '${tmpfile}'" EXIT
48 rsync_opts="-niaH$verify_content --delete"
50 if rsync --version | grep -q xattrs; then
51 rsync_opts="$rsync_opts -AX"
53 echo "Not comparing xattrs/acls (unsupported by available rsync)." 1>&2
56 rsync $rsync_opts "$src" "$dest" > "${tmpfile}"
58 if test $(wc -l < "${tmpfile}") != 0; then
59 echo "Differences between $src and $dest"