[<<]Message[>>]    [<<]Author[>>]    [<<]Subject[>>]    [<<]Thread[>>]

Number : 9185 Date : 2004-11-10 Author : John Zeman Subject : Re: Exclude file not working Size(KB) : 6
--- In xxcopy@yahoogroups.com, "russellgadd" wrote: > > I can't get an exclude file to work. > Please could you advise where I am going wrong. > > My batch file reads as follows: > > d: > cd \backup > md daily > cd daily > xxcopy "c:\Documents and Settings\*.*" "Documents and Settings\" > /BN/C/S/H/R/Y/Q1/FF /EX"C:\Documents and Settings\R\My > Documents\Data\Backup\routines\exclude xxcopy.txt" /on"C:\Documents > and Settings\R\My Documents\Data\Backup\log\dailydocs.log" > > the file "exclude xxcopy.txt" contains (some more have been missed out > here for brevity): > ntuser* > usrclass* > desktop.ini > R\cookies\*\* > R\recent\*\* > R\Local Settings\history\*\* > R\Local Settings\Temp\*\* > R\Local Settings\Temporary Internet Files\*\* > R\Application Data\Arcsoft\*\* > R\Application Data\Sun\*\* > R\Application Data\Mozilla\Firefox\Profiles\1ovwlfk8.default\Cache\*\* > R\Application > Data\Mozilla\Firefox\Profiles\1ovwlfk8.default\Cache.Trash\*\* > All Users\Application Data\Microsoft\Network\Downloader\*\* > default user\*\* > > The log file is as follows > > ================================================== > ============================= > XXCOPY ver 2.85.8 2004-11-10 18:24:34 Windows Ver 5.1.2600 > Command Line = xxcopy "c:\Documents and Settings\*.*" "Documents and > Settings\" /BN/C/S/H/R/Y/Q1/FF /EX"C:\Documents and Settings\R\My > Documents\Data\Backup\routines\exclude xxcopy.txt" /on"C:\Documents > and Settings\R\My Documents\Data\Backup\log\dailydocs.log" > -------------------------------------------------- > ----------------------------- > Switch Parameters > /A0 /BN /C /CA /CB0 /CCY /CK /CR3 /D0 /DL0 /E0 /EC0 /ED0 /ER0 > /EX"C:\Documents and Settings\R\My > Documents\Data\Backup\routines\exclude xxcopy.txt" > /F0 /FM0 /FF2S /FL /FR /FW /H /I0 /IN*.* /K0 /L0 /N0 /NP0 /NX /NI0 > /NW /NC0 > /oN"C:\Documents and Settings\R\My > Documents\Data\Backup\log\dailydocs.log" > /oD1 /oE0 /oF1 /oI0 /oP0 /oS0 /oX0 /P0 /PB0 /PC0 /PD0 /PN /Po0 /PZ0 > /Q1 /QF0 > /QB0 /QS0 /R /S /SP0 /SG0 /SX0 SZ:- /T0 /TR00 /TS0 /TD0 /TTA0 /TCA0 > /TCC0 > /TCW /TM0 /U0 /V0 /W0 /WD /WV /Y /Z0 /ZE0 /ZS0 /ZX0 > -------------------------------------------------- > ----------------------------- > Source base directory = "C:\Documents and Settings\" > Destination directory = "D:\backup\daily\Documents and Settings\" > File name template = "*.*" > -------------------------------------------------- > ----------------------------- > Exclusion Specifier Files > C:\Documents and Settings\R\My Documents\Data\Backup\routines\exclude > xxcopy.txt 52 items > -------------------------------------------------- > ----------------------------- > Exclusion Items Optimization > C:\Documents and Settings\R\Application > Data\Mozilla\Firefox\Profiles\1ovwlfk8.default\parent.lock > Copy failed > -------------------------------------------------- > ----------------------------- > Directories processed = 906 > Total data in bytes = 429,967,893 > Elapsed time in sec. = 113.3 > Action speed (MB/min) = 227.6 > Files examined = 6,246 > Files copied = 6,245 > Directories created = 760 > Files copy failed = 1 > Log File Created = "C:\Documents and Settings\R\My > Documents\Data\Backup\log\dailydocs.log" > Exit code = 101 (Exit code is the number of failures plus > 100) > > Looking at the destination, the first 3 items in the exclude list have > not been copied (i.e. the simple filespec without a directory spec) > but the directories I have tried to exclude still get copied. A few suggestions. One, I would rewrite the batch file to be this: xxcopy "C:\Documents and Settings\" "D:\backup\daily\Documents and Settings\" /BN/S/H/R/Y/Q1/FF/oX2 /EX"C:\Documents and Settings\R\My Documents\Data\Backup\routines\exclude xxcopy.txt" /on"C:\Documents and Settings\R\My Documents\Data\Backup\log\dailydocs.log" By using the above batch file you can eliminate the first steps in your batch file which are: d: cd \backup md daily cd daily I'd do that not only to simplify the batch file, I'd do that because it can be pretty risky not specifying a specific destination directory. An xxcopy destination directory of just "Documents and Settings\" is working for you, however if for any reason the current directory is not d:\backup\daily\ then your files will be copied to some place unexpected instead of to where you want them copied. Besides, xxcopy will create the destination directory if it does not first exist so it's actually simpler to do it this way. About your exclusions. Note in the above suggested batch file /oX2 was added. With this option added you can study the log file which will now list your exclusions the way xxcopy has interpreted them. The primary problem with your exclusions is you did not enclose the path names that have spaces in them, with double quotes. Instead of this exclusion: R\Local Settings\history\*\* you should use this one: "R\Local Settings\history\*\*" Also ending an exclusion directory with \*\* is ok, but it is the same thing as ending the directory with just \ so you could shorten it further to: "R\Local Settings\history\" or if you want all "\History\" directories for all users excluded you can do this: *\history\ or use the full path to each directory (or file) you want to exclude. For example: "C:\Documents and Settings\R\Cookies\" or if you prefer, you can drop the C: so the above can also be: "\Documents and Settings\R\Cookies\" Finally, going back to your batch file, because it is such a long command line, and since long command lines can be difficult to understand, I'd use some variables to simplify it. The following is the same as my first batch file suggestion at the top of this page: set SRC=C:\Documents and Settings\ set DST=D:\backup\daily\Documents and Settings\ set OPTS=/BN/S/H/R/Y/Q1/FF/oX2 set EXCLUDE=C:\Documents and Settings\R\My Documents\Data\Backup\routines\exclude xxcopy.txt set LOG=C:\Documents and Settings\R\My Documents\Data\Backup\log\dailydocs.log xxcopy "%SRC%" "%DST%" %OPS% /EX"EXCLUDE" /on"%LOG%" John
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.