1#! /bin/sh 2 3. ${tstdir-.}/lib.sh 4. ${tstdir-.}/conf.sh 5 6rm -rf dir1 dir2 dir3 7# make the copy-from-here tree 8mkdir dir1 9cd dir1 10generate_tree_1 11# make the tree we want to compare to 12mkdir ../dir2 13cd ../dir2 14generate_tree_1 15 16# Also make the target tree and mess up some permissions in there. 17# We expect rsync to reset this to what dir1 has. 18mkdir ../dir3 19cd ../dir3 20generate_tree_1 21chmod 600 foo/bar/baz/one.txt 22touch -m -t 199901020405 foo/bar/baz/one.txt 23chmod 470 foo/bar/baz/one2.txt 24touch -m -t 199901020405 foo/bar/baz/one2.txt 25 26cd .. 27$rsync -a dir1/ dir3 28compare_trees dir2 dir3 29