CYGWIN Rsync exclude/include problem

Dalton Harvie daltonh at ualberta.ca
Sat Mar 22 07:42:28 EST 2003


Newbie response:

How about:

rsync -avvvzl --stats --delete --delete-excluded 
--exclude-from=c:\rsync\includes.txt /cygdrive/c/* mike at puk::LaptopBackup

as I've had problems with the --delete flag without using the * before (see 
down the list a bit, "can't delete older file/directory links on another 
local partition after `snapshot' type backup script")

and for the file something like

- *.tmp    # put these first as runs through list from top
- Temp/    #Exclude all Temp folders
- UserData/    #Exclude all UserData folders
- *.dmp
- Temporary Internet Files/
- cache/
- RECYCLER/
- Help/

+ /Databases/    #Include /Databases & subfolders
+ /Databases/**  # includes all the files and tree under this

+ /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/     
+ /Documents and Settings/**

# other directories included in the same way

- *     #exclude everything else

Maybe this might work?  Dalton Harvie.

On Friday 21 March 2003 10:22, 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
>
> 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