Patronizing the exclude * option

Maurice Volaski mvolaski at
Thu Aug 1 08:19:52 EST 2002

>Maybe --include=*/ --exclude=* ?
>Of course, that will sync the entire directory tree, but without 
>files that are
>not explicitely included.
>Ugly, but won't waste much transfer time.

Seems I have a working script now...


# name of script: subdirname
# This script takes a root directory and subdirectory and
# returns the intervening parent directories
# needed to include files in the given subdirectory
# when exclude=* is passed to rsync.
# paths must be enclosed in double quotes in case they
# contain spaces.

if [ "$ROOTPATH" != "$SUBPATH" ]
  SUBDIRECTORY=`/usr/bin/dirname "$SUBPATH"`
  /bin/echo "$SUBDIRECTORY"
  /usr/local/bin/subdirname "$ROOTPATH" "$SUBDIRECTORY"

Maurice Volaski, mvolaski at
Computing Support, Rose F. Kennedy Center
Albert Einstein College of Medicine of Yeshiva University

More information about the rsync mailing list