CYGWIN Rsync exclude/include problem

Max Bowsher maxb at ukf.net
Sat Mar 22 06:29:20 EST 2003


Mike Lavender wrote:
> I'm having troubles with getting rsync 2.5.5 (CYGWIN version) to
> include/exclude files they way I expect it to. I have mulled over the
> list postings and man pages regarding this and I am either missing
> something or ... well I don' know.
>
> I have a drive with 12 folders in the root however, I only want to rsync
> 5 of them (the ones marked with an *) and in those 4 I want to exclude
> certain folders and file patterns. The Root looks like this:
>
> /Backup
> /Copied DVD
> /Databases    *
> /Documents and Settings    *
> /Inetpub    *
> /Plus11    *
> /Program Files
> /rsync    *
> /Temp
> /Windows
> /Trial Software
> /wmpub
>
> Using the following command line and includes.txt file I still get the
> Backup, Copied DVD etc folders. If I add a global * or /* then nothing
> gets rsynced. I have "commented" the include file to explain my logic.
> Any advice would be great!
>
> Thanks in advance.
> Mike Lavender
> ===================
>
> Command Line:
> rsync -avvvzl --stats --delete --delete-excluded
> --exclude-from=c:\rsync\includes.txt /cygdrive/c/ mike at puk::LaptopBackup
                 ^^^^^^^^^^^^^^^^^^^^^

Are you running this from the Cygwin shell (bash)? If so, the shell will eat
the backslashes. Try writing it as /cygdrive/c/rsync/includes.txt. If that
doesn't work, then run with -vv to get info on how the exclude patterns are
working.


Max.

>
> includes.txt:
> + /Databases/    #Include /Databases & subfolders
>
> + /Documents and Settings/     #Include /Documents and Settings &
> subfolders
> - /Documents and Settings/NetworkService/     #Exclude /NetworkService
> subfolders
> - /Documents and Settings/LocalService/     #Exclude /LocalService
> subfolders
> - /Documents and Settings/All Users/     #Exclude /All Users subfolders
> - /Documents and Settings/Default Users/     #Exclude /Default Users
> subfolders
>
> + /Inetpub/    #Include /Inetpub & subfolders
> + /Inetpub/wwwroot/    #Include /Inetpub/wwwroot & subfolders
> - /Inetpub/*    #Exclude /files and other folders?? in Inetpub
>
> + /Plus11/
> + /Plus11/MYOBData/
> + /Plus11/Forms/
> + /Plus11/Old*/    #Include folders that start with Old
> - /Plus11/*
>
> + /rsync/
>
> - *.tmp    #Exclude all *.tmp files
> - Temp/    #Exclude all Temp folders
> - UserData/    #Exclude all UserData folders
> - *.dmp
> - Temporary Internet Files/
> - cache/
> - RECYCLER/
> - Help/
> - /*     #exclude not specifically included files * folders in the root.



More information about the rsync mailing list