使用xcopy遇到的一個問題

 我需要從遠端的服務器拷貝一個大的目錄(>1G)到本機,在Console中我使用了xcopy命令。過了幾十分鐘之後,在copy一個大的文件(大約500M)時出現了錯誤:

                        File creation error - the specified network name is no longer available.

不知道這個錯誤什麼意思,在google上搜索了一下,找到了一篇好的文章:http://www.xxcopy.com/xxgroup/m08/msg08400.htm。Garry很細心,對很多情況進行了測試。得出的結果是:造成這個錯誤是由於網絡連接不好導致的。沒有辦法,只能讓遠程機器開一個ftp給我用。

 

我把這篇文章貼在最後:

 

--- In [email protected], "dcohn99"  wrote:
> As to your very detailed response, thank you, but my question
> still comes down to why are other applications able to display
> and/or copy the files from the system in question. Examples
> like Dir and xcopy.


I did some testing across a lan using a similar setup as Doug
has described although I don't have an ME machine so couldn't
duplicate it exactly. To simulate a network problem, I tried
two methods:

1. I removed the cable - permanent disconnection
2. On the remote PC, I closed the connection several times with
a NET SESSION //PC /D /Y. This results in a brief disconnection
until windows re-establishes the connection.

Here's a summary of what I tried and the results. In each case,
the source was a remote PC (either mapped to a drive or via
UNC) and the dest was local. The xxcopy/xcopy command was a
simple copy to an empty destination. The source consisted of
19 files between 1.5Mb and 4.2Mb.

Test 1.
=======
src=mapped drive on W2k
dst=local NT4
command=xxcopy n:/test/ d:/test/ /bu/pb/onxxcopy.log/oe3

1. When the plug was pulled, xxcopy/windows waited approx 90secs
then terminated with exit code 101. The error reported by xxcopy
was #240 "Unspecified system error". NET HELPMSG 240 gives this
as "The session was cancelled". Not all files were copied.

If the cable was re-connected during the wait state, the copying
continued unabated and terminated normally.

2. When the session was closed, xxcopy immediately issued a
"Copy failed" message on the console then the copying continued
with the next file and terminated with exit code 100+no of
failed copies and error #240 as for 1.

Test 2. As for 1 but swapped PC's
=======
src=mapped drive on NT4
dst=local W2k
command=xxcopy n:/test/ d:/test/ /bu/pb/onxxcopy.log/oe3

1. When the plug was pulled, xxcopy/windows waited approx 90secs
then terminated with exit code 101. The error reported by xxcopy
was #64 "The specified network name is gone". NET HELPMSG 64
gives this as "The specified network name is no longer available"

If the cable was re-connected during the wait state, the copying
continued unabated and terminated normally.

2. When the session was closed, xxcopy immediately issued a
"Copy failed" message on the console then the copying continued
with the next file and terminated with exit code 100+no of failed
copies and error #64 as for 1 but on one occassion gave error #6
"Incorrect internal file identifier". NET HELPMSG 6 gives this
as "The handle is invalid".

Test 3. As for 2 but using /cr30
=======
src=mapped drive on NT4
dst=local W2k
command=xxcopy n:/test/ d:/test/ /bu/pb/onxxcopy.log/oe3/cr30

2. Exactly the same as above i.e. /cr30 had no effect.

Test 4. As for 3 but using UNC src
=======
src=UNC drive on NT4
dst=local W2k
command=xxcopy //pc/d/test/ d:/test/ /bu/pb/onxxcopy.log/oe3/cr30

2. Exactly the same as above i.e. UNC made no difference.

Test 5. As for 2 but using xcopy
=======
src=mapped drive on NT4
dst=local W2k
command=xcopy n:/test/* d:/test/ /s/c

1. When the plug was pulled, xcopy/windows waited approx 50secs
then terminated with exit code 0!! The console listed multiple
"Unable to create directory ....." followed by "File creation
error - the network path was not found".

If the cable was re-connected during the wait state, the copying
continued unabated and terminated normally.

2. When the session was closed, xcopy continued with the copy
and copied the files normally. However if the session was
closed repeatedly with no pause between each closure, xcopy
issued a "File creation error - the specified network name
is no longer available" (this is the same as #64 above).
If the session was left to then re-establish itself, xcopy
continued copying the remaing files and terminated with
exit code 0.


So the conclusions that might be drawn from this.

1. The #error codes reported by windows/xxcopy with /oe3 are
system dependent. NT4 reported different error numbers to W2k
for the same error condition. The #error codes reported by
Doug on ME are different again however the descriptions in
all cases are similar.

2. Xxcopy reports a 101 "success" code even when the cable
is pulled and the source is permanently lost. Xxcopy then
stops copying (or trying to copy) any further files and
terminates. This is however a lot better than xcopy's 0
exit code although it does at least list the file names
of the failed copies to the console.

3. Xxcopy doesn't re-try on failed network access errors
even temporary disconnects. Xcopy does wait for a while
(not certain how long - about 5-10 secs).

4. Don't rely on either xxcopy's or xcopy's exit code as
the sole determinant of the success or failure of a
network copy. Xxcopy exit code 101 or higher may be a
critical error. Xcopy exit code 0 may be a critical error.
I guess system admins need to make sure they use /oe2 or
/oe3 and check the logs for critical #error_nos.

5. I'm not sure why xxcopy terminates when the network
cable is disconnected and a #64 error results but continues
when the session is closed and a #64 error results.
Similarly, I don't know why xxcopy/windows waits 90 secs
on a cable disconnect but xcopy waits 50 secs. Maybe
there is further status checking within xxcopy which
determines whether xxcopy terminates.

6. I couldn't replicate Doug's #55 error which resulted
in a termination of xxcopy but presumably it is similar
to the W2k #64 errors and the status reports look like
a permanent disconnection on an ME system.

Garry
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章