[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2812
  • Last Modified:

Robocopy skipped files

I want to use robocopy to copy a directory structure on a windows 2003 server to an external hard drive.  I have the job scheduled to run nightly and each night I want the external hard drive to have an exact copy of what is on the server.

My robocopy command is:
robocopy "path here to the top-level folder" "path to the external drive" /E /COPYALL /PURGE /Log: "path to log file"

When I look at the log I see
Dirs - 0 copied 981 skipped
Files - 10 copied 20708 skipped
Bytes - 80 copied 7.098 skipped

Why is it skipping files at all?  COPYALL should copy everything and skip nothing.
1 Solution
Files that have already been copied would be skipped because the archive bit is set.  Could that be what's happening for your job?
Close, but not quite correct, sorry.
robocopy doesn't care about the Archive bit by default; it has its own "file classes" (CHANGED, NEWER, OLDER, EXTRA, LONELY, SAME, TWEAKED).
The file class determines whether a file is copied or not; a "SAME" file (same size and date in source and destination) isn't copied *by* *default*; you'd have to add "/IS" (Include Same) if you insist on copying every file every time.

As long as you don't see any files under "Failed" in the job summary, you should be fine.
If you want to automatically verify whether the robocopy job ended successfully, check the errorlevel; typically, only an errorlevel of 4 or higher indicates a serious error. EXTRA files are files that exist in the destination, but not the source; these files will be deleted if robocopy is run with /purge or /mir.

Check out robocopy.doc in the installation folder of the W2k3 Resource Kit for details.
Thanks for the clarification.
Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

Steve KnightIT ConsultancyCommented:
It is skipping the files that match the time/date/size of the destination ones.

The /copyall option just means to copy the various attributes such as timestamps etc.  The full list is:

( D=Data, A=Attributes, T=Timestamps).
(S=Security=NTFS ACLs, O=Owner info, U=aUditing info).
/COPYALL :: COPY ALL file info (equivalent to /COPY:DATSOU).

The /E /PURGE (which is the same as just /MIR) makes the two areas the same.

Steve KnightIT ConsultancyCommented:
Sorry, hadf that open for a while and hadn't refreshed like I thought I had!

santaspores1Author Commented:
Excellent - thank you!  That wasn't clear from the documentation (IMHO).

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now