On Fri, Oct 06, 2000 at 07:36:06PM -0400, Sanjeev Jha wrote:
> My include -exclude option is not working. I am not able to figure out the
> problem.
>
> Here is what I am doing ....
>
> INLD=/export/script/incld-file
> EXLD=/export/script/exld-file
> OPTION=" --stats --include-from=$INLD --exclude-from=$EXLD"
> echo " Enter files name/ dir name to be included
> read AFILE
> echo $AFILE >> $INLD
> ..........................................
>
> ..same for exclude file
>
> The include file looks like
> # cat incld-file
> /export/home/*
> /tmp/*
>
> # cat exld-file
> /export/home/Mail
>
>
> finally ---- > rsync -avz $OPTIONS $HOME/rsync_script
> server::module
>
> Now at the server end, I am getting only $HOME/rsync_script. I am not
> getting any file from "excluded-file".
The include & exclude options are filters applied to the files
specified on the commands line. The only file you specified was
$HOME/rsync_script, so it's the only one that could possibly be
transferred.
Also, when /export/home/Mail is considered, it will match
/export/home/* and so it'll be included not excluded. The include &
exclude options are considered in the order in which they are
specified.
So if you want to backup all of /export/home except for the Mail
directory, you should do
rsync -avz --exclude=/export/home/Mail /export/home server::module
> Any suggestion. BTW, I saw in rsync archive, someone using /foo/**
> ........... What is the use of "**" ..is it same as "/foo/*" ....
Read the manual: http://rsync.samba.org/ftp/rsync/rsync.html
--
Martin Pool
PGP signature