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@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.
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@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.
Newbie response: How about: rsync -avvvzl --stats --delete --delete-excluded --exclude-from=c:\rsync\includes.txt /cygdrive/c/* mike@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@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.
On Fri, Mar 21, 2003 at 12:22:15PM -0500, Mike Lavender wrote:> + /Databases/ #Include /Databases & subfoldersDo you realize that this is specifying a file whose name starts with 4 spaces and contains a '#' character in it? If you want to put comments into your include/exclude file, they must occupy the whole line and the comment character (either '#' or ';') must come in the very first column of the file, like this: # Include /Databases & subfolders + /Databases/ However, I'd reserve comments for things that don't have such an obvious meaning. ..wayne..
On Fri, Mar 21, 2003 at 12:22:15PM -0500, Mike Lavender wrote:> > Command Line: > rsync -avvvzl --stats --delete --delete-excluded --exclude-from=c:\rsync\includes.txt /cygdrive/c/ mike@puk::LaptopBackupFirst, get rid of the backslashes. Second, drop verbosity to just -vv (not -vvv). Dont use more verbosity that you need, it just gets in the way. With -vv rsync will report what rule applied to each path. Read it. Study it. See if the rules applied are the expected ones or not. If you are going to generate debug messages you aught to be reading them.> 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. > > -- > To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync > Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html-- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: jw@pegasys.ws Remember Cernan and Schmitt
Thank you all for your input. It turns out that the problem is a CRLF/LF problem. I'm including the explanation of the problem/solution for others. Using -vvv resulted in the listing of include/excludes as follows (I have only listed a couple of lines to keep it short): ,exclude)de(! ,exclude)de(+ Databases/ ,exclude)de(+ Documents and Settings/ ... This seemed odd but not unreasonable, having never seen the proper output from the -vvv option. What clued me in was that when I dumped the output to a log file using rsync blahblahblah >output.txt I got the following: add_exclude(+ Databases/,exclude) add_exclude(+ Documents and Settings/,exclude) add_exclude(- Documents and Settings/NetworkService/,exclude) This was a bit more intuitive and suggested to me that it might be a CRLF/LF issue. I was aware of the difference between a *nix EOL and Windows EOL so I created the file using Word with Line feeds instead of just <ENTER>. Apparently this was not enough. Ultimately if I recreate the list using PICO the listing appeared as above instead. Problem solved!!! Now that I have it working (the way the man pages say it should) I can tidy up my list! It does raise the following question. What is the actual WINDOWS character code for a *nix line feed. eg. chr(13)???. Thanks again. Mike Lavender -----Original Message----- From: Mike Lavender Sent: March 21, 2003 12:22 PM To: rsync@lists.samba.org Subject: CYGWIN Rsync exclude/include problem 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@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. -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html