I'm trying to backup certain pieces of my XP workstations home directory to a mapped drive using rsync on Cygwin. I was able to create a fairly useful exclude-from list, but I'm unable to re-include portions a subset of an excluded directory. My rsync command looks like this: rsync -avn --delete --stats ~/ \ /cygdrive/i/HRMS/rdavies/backup/home \ --exclude-from=/home/rdavies/rsync_home_list And the exclude file looks like this: + Application\ Data/IDMComp/** + Application\ Data/Mozilla/** - Application\ Data/* - Cookies/* - Desktop/* - Favorites/* - Local\ Settings/* - My Documents/Outlook/* - My Documents/My\ * - NetHood/* - PrintHood/* - Recent/* - SendTo/* - Start Menu/* - Templates/* - .DCOPserver* - .fonts* - NTUSER* - ntuser* I've tried as many variations on the include portions as I can think of. The variations I've tried are: Adding an initial / to the + lines (so it would read + /Application\ Data/etc...) Different variations on the number of asterisks. (/ or /* or /** or /***) Removing the final / altogether. Nothing I have tried on the + lines has made any difference whatsoever, the list of files to sync remains constant. bash-3.00$ rsync --version rsync version 2.6.6 protocol version 29 Copyright (C) 1996-2005 by Andrew Tridgell and others <http://rsync.samba.org/> Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles, inplace, no IPv6, 64-bit system inums, 64-bit internal inums rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the GNU General Public Licence for details. bash-3.00$ ____________ Roger Davies PeopleSoft HRMS 970.506.7750 Important Notice: The contents of this electronic message and any attachments are intended only for the addressee and may contain confidential and privileged information. If you are not the addressee, you are notified that any transmission, distribution, downloading, printing or photocopying of the contents is strictly prohibited. If you have received this message in error, please notify the sender by return e-mail immediately and destroy all copies of the message and any attachments. Thank you.
On Wed, May 10, 2006 at 12:30:32PM -0600, Davies, Roger wrote:> + Application\ Data/IDMComp/**(FYI, there's no need to backslash a space, but I suppose it doesn't hurt.) You have neglected to add rules to let rsync get down into any of those parent dirs mentioned in this rule, so this rule will never encounter anything to match. If you had specified this: + Application Data/ + Application Data/IDMComp/ + Application Data/Mozilla/ - Application Data/* ... then you should see what you expect. (You don't need the .../** lines because you don't have a trailing "- *" rule.) Other changes I assume you want (mainly removing a trailing '*' so that the directory is excluded in addition to its content): - Cookies/ - Desktop/ - Favorites/ - Local\ Settings/ - My Documents/Outlook/ - My Documents/My\ * - NetHood/ - PrintHood/ - Recent/ - SendTo/ - Start Menu/ - Templates/ - .DCOPserver* - .fonts* - NTUSER* - ntuser* It is also safer to anchor rules that should only match in one place by using a leading '/', but I'll let you figure out which ones should get that. ..wayne..
Wayne, thanks for the quick reply.>You have neglected to add rules to let rsync get down into any of those >parent dirs mentioned in this rule, so this rule will never encounter >anything to match. If you had specified this: > >+ Application Data/ >+ Application Data/IDMComp/ >+ Application Data/Mozilla/ >- Application Data/*[RD] I actually tried this, and it seems the include lines are just being ignored. I've tried with the slash and without, as well as adding from 1 to 3 asterisks in desperation. Always with the same results, the include lines are ignored. SO, this exclude file + /Application\ Data/IDMComp/ + /Application\ Data/Mozilla/ - /Application\ Data/* - /Cookies/* - /Desktop/* - /Favorites/* - /Local\ Settings/* - /My Documents/Outlook/* - /My Documents/My\ * - /NetHood/* - /PrintHood/* - /Recent/* - /SendTo/* - /Start Menu/* - /Templates/* - .DCOPserver* - .fonts* - NTUSER* - ntuser* - /*.txt - /*.exe.* Is identical (in terms file results) to - /Application\ Data/* - /Cookies/* - /Desktop/* - /Favorites/* - /Local\ Settings/* - /My Documents/Outlook/* - /My Documents/My\ * - /NetHood/* - /PrintHood/* - /Recent/* - /SendTo/* - /Start Menu/* - /Templates/* - .DCOPserver* - .fonts* - NTUSER* - ntuser* - /*.txt - /*.exe.*>Other changes I >assume you want (mainly removing a trailing '*' so that the directory >is excluded in addition to its content):[RD] Initially, I left the trailing '*' off, as you are absolutely correct I would prefer not to get the directory at all. However, if I leave the '*' off, rsync is descending through the directory chain as if there were no exclusion line at all.>It is also safer to anchor rules that should only match in one place by >using a leading '/', but I'll let you figure out which ones should get >that.I did add some '/' anchors, and added a couple of additional lines with anchors to exclude. Thanks Roger Important Notice: The contents of this electronic message and any attachments are intended only for the addressee and may contain confidential and privileged information. If you are not the addressee, you are notified that any transmission, distribution, downloading, printing or photocopying of the contents is strictly prohibited. If you have received this message in error, please notify the sender by return e-mail immediately and destroy all copies of the message and any attachments. Thank you.
Actually, I had it, I just can't cut and paste to email properly. However, I did just try removing the backslash '\' from everywhere, and that was the trick. I had issues getting the '~/My Documents' recognized from the command line, so I went with all the backslashes. SO, broken: +\ /Application\ Data/ +\ /Application\ Data/IDMComp/ +\ /Application\ Data/Mozilla/ -\ /Application\ Data/* -\ /Cookies/* -\ /Desktop/* -\ /Favorites/* -\ /Local\ Settings/* -\ /My\ Documents/Outlook/* -\ /My\ Documents/My\ * -\ /NetHood/* -\ /PrintHood/* -\ /Recent/* -\ /SendTo/* -\ /Start\ Menu/* -\ /Templates/* -\ .DCOPserver* -\ .fonts* -\ NTUSER* -\ ntuser* -\ /*.txt -\ /*.exe.* STATS: Number of files: 407 Number of files transferred: 314 Total file size: 103257562 bytes Total transferred file size: 103257462 bytes Literal data: 0 bytes Matched data: 0 bytes File list size: 9714 File list generation time: 0.260 seconds File list transfer time: 0.000 seconds Total bytes sent: 12172 Total bytes received: 2462 Fixed: + /Application Data/ + /Application Data/IDMComp/ + /Application Data/Mozilla/ - /Application Data/* - /Cookies/* - /Desktop/* - /Favorites/* - /Local Settings/* - /My Documents/Outlook/* - /My Documents/My * - /NetHood/* - /PrintHood/* - /Recent/* - /SendTo/* - /Start Menu/* - /Templates/* - .DCOPserver* - .fonts* - NTUSER* - ntuser* - /*.txt - /*.exe.* STATS: Number of files: 484 Number of files transferred: 370 Total file size: 106288398 bytes Total transferred file size: 106288298 bytes Literal data: 0 bytes Matched data: 0 bytes File list size: 11631 File list generation time: 0.430 seconds File list transfer time: 0.000 seconds Total bytes sent: 14551 Total bytes received: 2924 I'm still getting the empty directories, but I don't really care! Important Notice: The contents of this electronic message and any attachments are intended only for the addressee and may contain confidential and privileged information. If you are not the addressee, you are notified that any transmission, distribution, downloading, printing or photocopying of the contents is strictly prohibited. If you have received this message in error, please notify the sender by return e-mail immediately and destroy all copies of the message and any attachments. Thank you.
Possibly Parallel Threads
- Accessing Windows file-system from Linux samba server
- Accessing Windows file-system from Linux samba server
- MSWord97 installs properly but still won't launch (or save?) -- 3 more data files
- Roaming profiles brings error with prf*.tmp files
- adding to: winlogon problem error with Default User/ "... does not