5 Usage: sync-tree [-h] [-c] [-x] SOURCE/ DEST/
6 Make the DEST tree match SOURCE as closely as possible
13 while getopts "h" OPTION
17 ?) usage 1>&2; exit 1;;
21 shift $(($OPTIND - 1)) || exit $?
32 rsync_opts="-aH --delete"
34 rsync_version=$(rsync --version)
35 if [[ ! "$rsync_version" =~ "ACLs" ]] || [[ "$rsync_version" =~ "no ACLs" ]]; then
36 echo "Not syncing ACLs (not supported by available rsync)" 1>&2
40 echo "Not syncing ACLs (not yet supported on $OSTYPE)" 1>&2
43 rsync_opts="$rsync_opts -A"
48 if [[ ! "$rsync_version" =~ "xattrs" ]] || [[ "$rsync_version" =~ "no xattrs" ]]; then
49 echo "Not syncing xattrs (not supported by available rsync)" 1>&2
51 rsync_opts="$rsync_opts -X"
54 exec rsync $rsync_opts "$src" "$dest"