xcopy, number of files limit?

A

Anon

I use xcopy through multiple 'Scheduled Tasks' to back-up files from
different directories, to a second physical hard drive. These tasks have
worked flawlessly for years, but recently I get a 0x4 exit code on one of
them (just one of them, the remainder still work correctly).

The only thing that has changed with the malfunctioning task--to the best of
my recollection--is that the number of files in the particular directory has
grown incrementally to over 28,000.

Does xcopy have a maximum permissible number of files before it ceases to
work, or can someone identify another cause of my problem?

Cheers.
 
G

Guest

-Early versions of XCOPY had file-count probs but I don't think recent ones
do.

A frequent problem with backups is that of over-long filenames. Filenames
are officially limted to 256 characters, but there are some circumstances
where apps can break this limit. One notorious example is Temporary Internet
Files.

If XCOPY hits an over-long filename it will bomb-out instead of just
skipping it, EVEN if /c is specified. This is a major issue as the entire
remainder of the backup is lost, not just the over-long name. The problem
affects many GUI programs too.

It's also possible the problem may be to do with permissions, though I don't
think permissions would normally cause the process to bomb-out.
 
P

Pegasus \(MVP\)

Anon said:
I use xcopy through multiple 'Scheduled Tasks' to back-up files from
different directories, to a second physical hard drive. These tasks have
worked flawlessly for years, but recently I get a 0x4 exit code on one of
them (just one of them, the remainder still work correctly).

The only thing that has changed with the malfunctioning task--to the best of
my recollection--is that the number of files in the particular directory has
grown incrementally to over 28,000.

Does xcopy have a maximum permissible number of files before it ceases to
work, or can someone identify another cause of my problem?

Cheers.

I have seen a few cases where xcopy.exe bombed out due to
running out of memory when dealing with very large or very
many files. Try xxcopy.exe (downloadable from various sites)
or robocopy.exe (Windows Resource Kit).

On a separate issue: You're punishing yourself or your users
if you allow folders to have more than 5,000 files each. There
is a big speed penalty.
 
R

Ron Martell

Anon said:
I use xcopy through multiple 'Scheduled Tasks' to back-up files from
different directories, to a second physical hard drive. These tasks have
worked flawlessly for years, but recently I get a 0x4 exit code on one of
them (just one of them, the remainder still work correctly).

The only thing that has changed with the malfunctioning task--to the best of
my recollection--is that the number of files in the particular directory has
grown incrementally to over 28,000.

Does xcopy have a maximum permissible number of files before it ceases to
work, or can someone identify another cause of my problem?

Are these files, or at least some of them, using Long File Names? If
so then you may be up against the limit for folder contents.

The maximum that a folder can hold is 65,534 directory entries. A
short (8 + 3) filename uses only a single entry but a long file name
uses a minimum of 3 directory entries, and even more if the name is
longer than 22 characters.

Good luck

Ron Martell Duncan B.C. Canada
--
Microsoft MVP (1997 - 2006)
On-Line Help Computer Service
http://onlinehelp.bc.ca
Syberfix Remote Computer Repair

"Anyone who thinks that they are too small to make a difference
has never been in bed with a mosquito."
 
T

Tim Slattery

Ron Martell said:
The maximum that a folder can hold is 65,534 directory entries. A
short (8 + 3) filename uses only a single entry but a long file name
uses a minimum of 3 directory entries, and even more if the name is
longer than 22 characters.

True for FAT32 but not for NTFS. The only limit in NTFS is
4,294,967,295 billion files on a partition.
 
R

Ron Martell

Tim Slattery said:
True for FAT32 but not for NTFS. The only limit in NTFS is
4,294,967,295 billion files on a partition.

You are correct Tim. Thanks for catching that one.

Ron Martell Duncan B.C. Canada
--
Microsoft MVP (1997 - 2006)
On-Line Help Computer Service
http://onlinehelp.bc.ca
Syberfix Remote Computer Repair

"Anyone who thinks that they are too small to make a difference
has never been in bed with a mosquito."
 
A

Anon

Anon said:
I use xcopy through multiple 'Scheduled Tasks' to back-up files from
different directories, to a second physical hard drive. These tasks have
worked flawlessly for years, but recently I get a 0x4 exit code on one of
them (just one of them, the remainder still work correctly).

The only thing that has changed with the malfunctioning task--to the best
of my recollection--is that the number of files in the particular
directory has grown incrementally to over 28,000.

Does xcopy have a maximum permissible number of files before it ceases to
work, or can someone identify another cause of my problem?

Cheers.

I gave up trying to get xcopy to work, and instead I've started using
robocopy as was suggested.
Thanks for the help.
 

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