Patronizing the exclude * option

Maurice Volaski mvolaski at
Wed Jul 31 10:03:01 EST 2002

I need to get around the requirement of --exclude=* to have all the 
parent directories of the files and directories that are to be 
included. So given the file..


I need to include

I could just include the entire directory structure , but 
alternatively just include the needed paths. So the question is how 
can I extract every parent directory of this path?

I tried writing a recursive routine that accepts /startdirectory as 
$1 and the pathname of filetobecopied as $2. Here is latest 
incarnation, which doesn't work right, of course.



if [ $rootpath -ef $subpath ]
  echo "end of recursion"
  echo $subpath
  echo $subpath
  SUBDIRECTORY=$(/usr/bin/dirname $subpath)
  /root/scripts/subdirname $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