some files vanished before they could be transferred

Matt McCutchen matt at mattmccutchen.net
Thu May 28 15:24:29 GMT 2009


On Thu, 2009-05-28 at 10:41 -0400, Larry Irwin wrote:
> So, I have a file like rsync.exclude that contains something like:
>  
> /media/cdrom*/*
> /media/floppy*/*
> /tmp/*
> /u/tmp/*
> /v/tmp/*
> /var/spool/lpd/*/df*
> /var/spool/lpd/*/hf*
> 
> And then in the script to kick off the rsync process:
>  
> EXCLUDE="--exclude proc/ --exclude sys/"
> [ -f ${RSYNCBASE}/cfg/rsync.exclude ] && {
>   set -f # Turn off filename globbing
>   for i in `cat ${RSYNCBASE}/cfg/rsync.exclude`
>   do
>     case $i in
>     ./*) Tmp=`echo $i | cut -c3-256`;;
>     /*) Tmp=`echo $i | cut -c2-256`;;
>     *) ;;
>     esac
>     EXCLUDE="${EXCLUDE} --exclude ${Tmp}"
>   done
>   set +f # Turn filename globbing back on
> }
> 
> Then I use ${EXCLUDE} in the rsync command...

You can just use --exclude-from=rsync.exclude rather than generating a
bunch of individual --exclude options.

-- 
Matt



More information about the rsync mailing list