Patronizing the exclude * option
Maurice Volaski
mvolaski at aecom.yu.edu
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...
#!/bin/sh
# 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.
ROOTPATH="$1"
SUBPATH="$2"
if [ "$ROOTPATH" != "$SUBPATH" ]
then
SUBDIRECTORY=`/usr/bin/dirname "$SUBPATH"`
/bin/echo "$SUBDIRECTORY"
/usr/local/bin/subdirname "$ROOTPATH" "$SUBDIRECTORY"
fi
--
Maurice Volaski, mvolaski at aecom.yu.edu
Computing Support, Rose F. Kennedy Center
Albert Einstein College of Medicine of Yeshiva University
More information about the rsync
mailing list