Link to home
Start Free TrialLog in
Avatar of Chi Is Current
Chi Is CurrentFlag for United States of America

asked on

XCOPY skipping files

BATCH FILE:  The following command overlooks and does not copy files in directory  D:\Thunderbird

xcopy "D:\*.*" Y:\JKB\Backup\D\ /d /s /r /y /f

Open in new window


Other files in other directories are copied.

Any ideas???
Avatar of Alex
Alex
Flag of United Kingdom of Great Britain and Northern Ireland image

Use robocopy

Robocopy  D:\*.* Y:\JKB\Backup\D\ /mir /r:0 /w:0

It'll give you a report at the end too.
Avatar of myousufali
myousufali

xcopy c:\source_folder_name e:\destination_folder_name /O /X /E /H /K

/E - Copies folders and subfolders, including empty ones.
/H - Copies hidden and system files also.
/K - Copies attributes. Typically, Xcopy resets read-only attributes.
/O - Copies file ownership and ACL information.
/X - Copies file audit settings (implies /O).

EX: xcopy "D:\*.*" Y:\JKB\Backup\D\   /O /X /E /H /K

As Alex said robocopy is also a better option which has many options to choose.

https://ss64.com/nt/robocopy.html
Based on the options in your original command, I would say you either don't have permissions to that folder, or since you are using /D that no files in that folder had changed since the last copy.


»bp
Did you close Thunderbird before copying?   Email apps busy out their files.
Avatar of Chi Is Current

ASKER

Thank you, all.  The problem persists.

- John: Yes, Thunderbird is closed prior to running the batch file.  I am a big fan of checking the obvious, has provided a solution many times.
            Thanks!

- bp ~ Plenty has changed in D:\Thunderbird since last backup.
          I notice: D:\Thunderbird -> Properties -> General remain: "Read-only (Only applies to files in folder)" remains CHECKED even after I clear it and -> "Apply".  Same for destination: Y:\JKB\Backup\D\Thunderbird-> Properties -> General remain: "Read-only (Only applies to files in folder)" remains CHECKED even after I clear it and -> "Apply".   weird!

myousufali and Alex ~ Both your examples for using "robocopy" basically perform the same way XCOPY does.  None update or, if I rename Y:\JKB\Backup\D\Thunderbird to x_Thunderbird, even write a new Y:\JKB\Backup\D\Thunderbird.

Individual files in D:\ are updated or written.

Perplexing part is: xcopy "D:\*.*" Y:\JKB\Backup\D\ /d /s /r /y /f DID work fine until 07/21/18, after which the problem arose.

With Gratitude ~:~ Seeking Joy.
Have you checked that D:\Thunderbird is not HIDDEN?


»bp
Bill ~  Thank you for your reply.  That was a good idea to check; however, D:\Thunderbird is not hidden in 'properties' of the directory.  To be certain I checked it to hidden -> apply then un-checked it -> apply.  No joy.  I also check Task Manager to be certain Thunderbird is indeed not running at the time of the backup.  I'm stumped.  Particularly because this batch file was working to the last week in September.
Thinking a bit more about how to "debug" this problem.

Try a run with /H added to your options also.

Try a run with /L added to the option list, and see if it mentioned that directory.

Also, try a run without the /D, but with the /L (so it doesn't actually copy anything).  See if that directory shows up then, without the /D constraint.


»bp
Bill ~

Thank you for your perseverance here.
Using all 3 suggestions, D:\Thunderbird is not mentioned.
In fact, xcopy "D:\Thunderbird\*.*" Y:\JKB\Backup\D\  did not copy it either!
I verified D:\Thunderbird\ IS on D:\ AND IS spelled this way - no typos.
Also checked to see if there is a file size limitation w/ XCOPY, many have stated there is not.
I CAN copy it manually to the specified destination in Windows Explorer

So, it's backed up...  This mystery is not affecting my quality of life.  However, would be illuminating to know why this isn't working.

Many thanks for your ideas and recommendations.

Health ~:~ Jacob
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you, All for your attention and ideas!
I copied files manually and intend to create a different BATCH file.

There IS a reason!

With Best Regards ~:~ Jacob