xxcopy not excluding files

L

Lou

I am xxcopy to go against the file I listed below. Everytime I run it
no matter what permutations I try, it always copies directories I didn't
ask for, like windows for instance. I even tried just /s option and to
no avail. Can someone please help?

I am running this command: xxcopy -cflouxxcopy.txt

and here is the file contents of louxxcopy.txt:

c:\ :: source
g:\Backup :: destination
/s :: subdirectories
/h :: copy system and hidden files
/bi :: back-up incrementally
/y :: supress overwrite prompt
/r :: overwrite read-only files
/q2 :: supress excluded files during output
/pb :: process bar
/xC:\WINDOWS\* :: exclude the following...
/x*.sys
/x*.com
/xC:\ntldr
/xC:\Games\*
/x"C:\My Music\*"
/xC:\Oracle\?\*
/x"C:\System Volume Information\*"
/x*\temp\*
/x*\cache\*
/x*.tmp
/x*.mpg
/x*.mp3
 
S

Spoon2001

Lou said:
I am xxcopy to go against the file I listed below. Everytime I run it
no matter what permutations I try, it always copies directories I didn't
ask for, like windows for instance. I even tried just /s option and to
no avail. Can someone please help?

I am running this command: xxcopy -cflouxxcopy.txt

and here is the file contents of louxxcopy.txt:

c:\ :: source
g:\Backup :: destination
/s :: subdirectories
/h :: copy system and hidden files
/bi :: back-up incrementally
/y :: supress overwrite prompt
/r :: overwrite read-only files
/q2 :: supress excluded files during output
/pb :: process bar
/xC:\WINDOWS\* :: exclude the following...
/x*.sys
/x*.com
/xC:\ntldr
/xC:\Games\*
/x"C:\My Music\*"
/xC:\Oracle\?\*
/x"C:\System Volume Information\*"
/x*\temp\*
/x*\cache\*
/x*.tmp
/x*.mpg
/x*.mp3

Hi Lou -

I'll try to help, but if you want truly expert help, go to the XXCOPY
Yahoogroup -

http://groups.yahoo.com/group/xxcopy

I haven't used the command file option. Any reason why you're using -CF
rather than /CF? The docs seem to favor the / character. But that doesn't
seem to be the problem.

I wonder if there needs to be an extra space before each /x in the command
file? probably not.

You might try using an exclusion file, e.g. "/EXexclude.txt"
Also, you may try making your exclusion specifiers relative to your source
directory rather than absolute - i.e. \windows\* rather than c:\windows

I had a problem like this with my exclusion specifiers (xspecs) and it
worked when I made the xspecs relative rather than absolute.

Here is my Exclude.txt:

pagefile.sys
c:\recycled\
c:\recycler\
"c:\documents and settings\my name here\local settings\temporary internet
files\"
c:\video\

So you see I made the first xspec a relative specifier and the the remainder
are absolute.

Good luck!
 
S

Spoon2001

Hi Lou,

It's me again.

I tried duplicating your command with a /? switch afterwards to get XXCOPY
to display help messages explaining your chosen parameters. For some
reason, the /? switch didn't work.

But it works for my command, in which I use the /EX command to specify a
text file with exclusion specifiers. This is what the /? switch displayed:

Exclusion specifier files -----------------
[ ] /X Exclusion items specified
[x] /EX Exclusion Specifier File(s)
c:\bat\exclude.txt 5
items

You just might try your luck with the /EX command - I'd be interested to
hear what happens.
 
K

Kan Yabumoto

Lou said:
I am xxcopy to go against the file I listed below. Every time I run it
no matter what permutations I try, it always copies directories I didn't
ask for, like windows for instance. I even tried just /s option and to
no avail. Can someone please help?

I am running this command: xxcopy -cflouxxcopy.txt

and here is the file contents of louxxcopy.txt:

c:\ :: source
g:\Backup :: destination
/s :: subdirectories
/h :: copy system and hidden files
/bi :: back-up incrementally
/y :: supress overwrite prompt
/r :: overwrite read-only files
/q2 :: supress excluded files during output
/pb :: process bar
/xC:\WINDOWS\* :: exclude the following...
/x*.sys
/x*.com
/xC:\ntldr
/xC:\Games\*
/x"C:\My Music\*"
/xC:\Oracle\?\*
/x"C:\System Volume Information\*"
/x*\temp\*
/x*\cache\*
/x*.tmp
/x*.mpg
/x*.mp3

----------------

I believe Lou's problem might be due to a (mis)understanding
of XXCOPY's exclusion rules (which is not an easy read).
The complete syntactic rules about XXCOPY's exclusion feature
are spelled out in the following page:

http://www.xxcopy.com/xxcopy05.htm

Admittedly, XXCOPY's exclusion specifier has messy syntactic
rules. This reflects our desire to cover more cases in
the use of wildcard --- if you don't understand all of the
rules, you need not use the one which is not clear to you.

Basically, the ending of the exclusion specifier tells a lot
about the class of files/directories that are excluded.

Let me just point out the problematic parts in the rules:

/xC:\Windows\*

this excludes the first-level files in the directory.
e.g., C:\windows\win.ini
C:\windows\system.ini
C:\Windows\explorer.exe

More specifically, it does not exclude files in the 2nd-level
or deeper subdirectories (such as c:\windows\system32\desktop.ini).

That is, the following two are distinct and different:

/xC:\Windows\* (1st-level files only
/xC:\Windows\*\* (everything in the C:\Windows\ directory)


Let me explain how this thing came about.
XXCOPY views a directory having two types of components
in its immediate contents:

1. files
2. subdirectories

To specify only files (not files in subdirectories)

/xC:\Windows\*

To specify only subdirectories (no 1st-level files)

/xC:\Windows\?\*

(naturally, when we say "subdirectories", everything inside
the subdirectories (both files and sub-subdirectories).

-----------------------------------------------------------
Note that the ..\?\* notation used in this context has
nothing to do with the "?" character interpreted in the
ordinary wildcard usage --- matches one character.
Rather, the ending ..\?\* is to denote subdirectories
but not the 1st-level files (the reason for the symbol-
overloading is that all other characters are valid in
filename and cannot be used to attach special meaning).
------------------------------------------------------------

To specify both files and subdirectories (i.e., both of the
above two types --- everything inside the directory),
you may specify it by either:

/xC:\Windows\
/xC:\Windows\*\*

(the above two are completely interchangeable).


In general, XXCOPY uses the funny notation, ..\*\..
to include subdirectories for the item (somewhat
parallel to the common "/S" switch. As a matter of fact,
we invented this notation in order to satisfy our desire
to let an item to cover its subdirectories in the spirit
of /S.

The following two lines will show the contrast between
the two:

/xabc\
/x*\abc\

Here, the first item specifies the directory "abc" which
is immediately below the source base directory.

The second one specifies any directory named "abc" in
any level of subdirectories under the source base directory.

------------------------------------------------------------
It is in the spirit of /S except that if we were to add /S,
it would modify the source specifier, not the particular
exclusion item. But, if we were allowed to use parentheses
to limit the scope, it would be like (/xabc\ /s) --- but
such a syntax would be too confusing, hence we invented
the ..\*\.. notation to denote the case which applies to
the respective subdirectories. /x*\abc\ is cleaner.
------------------------------------------------------------

In one occasion, Lou did use the \?\* notation:

/xC:\Oracle\?\*

This exclusion item applies to *ALL* subdirectories inside
the C:\Oracle\ directory but does not apply to the files
which are located immediately below C:\Oracle\.

My guess is that Lou was probably thinking that the following
two are the same

/xC:\Games\*
/xC:\Games\

As I said, the above two are not the same.

On the other hand the following two are equivalent and
completely interchangeable

/xC:\Games\
/xC:\Games\*\*

In conclusion, Lou's problem will probably go away if he
changes the XXCOPY command by replacing the sequence of
backslash-asterisk by just a backslash (in five
instances except for the C:\Oracle\?\*.

One last comment: other than the misunderstanding of the
trailing asterisk, Lou's command file is quite solid.
To make it even more robust, consider adding the /ILS and/or
/ILD switch which checks the source and destination volume
label respectively (these features are recently added).


Kan Yabumoto
The Author of XXCopy
 
L

Lou

That was it...after a more careful read of the rules, I was able to
xxcopy last night. Thanks all for your support!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top