ROBOCOPY puts the date 1/1/1980 on some copied files

user1944272 picture user1944272 · Jun 24, 2014 · Viewed 7.2k times · Source

I am having an intermittent issue with ROBOCOPY copying files with an incorrect date.

I am using ROBOCOPY to copy backup files from a local folder to a remote fileshare as a part of having a remote backup solution. The script is scheduled through task manager to run daily. Here is pseudo code:

ROBOCOPY E:\LocalFolder \\RemoteServer\FileShare\Folder *.bak

Most of the files copy with the correct file date, hovever one or two files sometimes will have the date of 1/1/1980. This presents a major issue with managing the backups in the fileshare because the dates are crucial to its management.

What might causes this? What can be done to prevent this behavior?

Answer

Mattio picture Mattio · Apr 9, 2015

I was having a similar issue. After some searching, I found reference to a behavior of Robocopy where it sets the modified date to 1/1/1980 until after a transfer is completed. [source]

What was really strange in my case was, if I watched the directory during the copy, I would see the file with the correct date appear, then AFTER it was complete the date would change to 1/1/1980. After some experimentation, I removed the /B switch I had been using and the dates seemed to be left alone.