Robocopy Modified Date Problem

Joined
Mar 16, 2017
Messages
8
Hi,

Since I updated to 11.3-U1 the robocopy script I run to sync an UNRAID server to my FreeNAS server always copies the new files, where previously It would have ignored the files once copied. On investigation I noticed that the copied files on the FreeNAS server had the modified date of *now* rather than the modified date of the UNRAID server, hence the files always re-copy. I've been running the Robocopy script for years without problem:

robocopy "z:\folder1" "\\freenas\folder1" /e /copy:dt /r:0 /w:0 /ndl /mir

Reverting back to 11.3-RELEASE fixed the problem.

Is there anything I can do about this issue?

Thanks

Herman
 

DekovaAlan

Cadet
Joined
Dec 14, 2019
Messages
1
I use the below script for just copies the new files and changed files and it works fine

@echo off
:: Incremental_Backup.bat Created by DA
:: It is a total copy first and then incrementally,
:: ie, it just copies the new files and changed files.
mode con cols=95 lines=5 & color 0E
Title %~nx0 for Incremental Backup with XCopy Command by DA
set "Settings=%~dp0Settings.ini"
Set "FirstFull_CopyLog=%~dp0%~n0_FirstFull_CopyLog.txt"
Set "LogFile=%~dp0%~n0_Incremental_CopyLog.txt"
If not exist "%Settings%" (
Call :BrowseForFolder "Please choose the source folder for the backup" SourceFolder
Setlocal EnableDelayedExpansion
If defined SourceFolder (
echo(
echo You chose "!SourceFolder!" as source folder
) else (
echo(
Color 0C & echo The source folder is not defined ... Exiting ......
Timeout /T 2 /nobreak>nul & exit
)
Call :BrowseForFolder "Please choose the target folder for the backup" TargetFolder
If defined TargetFolder (
echo(
echo You chose "!TargetFolder!" as Target folder
) else (
echo(
Color 0C & echo The Target folder is not defined ... Exiting ......
Timeout /T 2 /nobreak>nul & exit
)
Timeout /T 3 /nobreak>nul
(
echo "!SourceFolder!"
echo "!TargetFolder!\Backups_%ComputerName%\"
)
cls & echo( & echo(
echo Please wait a while ... The Backup to "!TargetFolder!" is in progress...
Call :Backup_XCopy "!SourceFolder!" "!TargetFolder!" "!FirstFull_CopyLog!"
Timeout /T 1 /nobreak>nul
Start "" "!FirstFull_CopyLog!" & exit
) else (
Setlocal EnableDelayedExpansion
for /f "delims=" %%a in ('Type "%Settings%"') do (
set /a idx+=1
set Param[!idx!]=%%a
)

Set "SourceFolder=!Param[1]!"
Set "TargetFolder=!Param[2]!"
echo(
echo The source Folder from Settings.ini is : !SourceFolder!
echo The Target Folder from Settings.ini is : !TargetFolder!
Timeout /T 1 /nobreak>nul & cls & echo( & echo(
echo Please wait a while ... The Backup to !TargetFolder! is in progress...
Call :Backup_XCopy !SourceFolder! !TargetFolder! !LogFile!
)
Timeout /T 1 /nobreak>nul
Start "" !LogFile! & exit
::****************************************************************************
:BrowseForFolder
set "psCommand="(new-object -COM 'Shell.Application')^
.BrowseForFolder(0,'%1',0,0).self.path""
for /f "usebackq delims=" %%I in (`powershell %psCommand%`) do set "%2=%%I"
exit /b
::****************************************************************************
:Backup_XCopy <Source> <Target> <LogFile>
Xcopy /c /d /e /s /i /y %1 %2 > %3 2>&1
Exit /b
::****************************************************************************

this script if you like coding and scripts, also there are GUI alternatives to robocopy that can do this job without any problems or consuming much time in coding, peer sync , gs richcopy360 and securecopy quest as an example.
 

AbsolutIggy

Dabbler
Joined
Feb 29, 2020
Messages
31
I've had similar problems, but I assumed it was because I'm migrating the backups from a different system to FreeNAS and hadn't updated the times yet. I'm hoping I've covered it now everything is back in sync.

Have you tried running robocopy with the /timfix option once? This might set the correct times, so that you can go back to normal afterwards.

Also, just BTW and AFAIK: /mir implies /e, so you don't really need that extra option.

Another thing I just realised looking at the documentation (here) is that there is a /COPY: option as well as /DCOPY option which is for directories. For directories, the default is DA(data, attributes) and not Time. I'm going to go add that to my scripts :)
 

tonci

Dabbler
Joined
Mar 14, 2013
Messages
18
Had the same issue and must revert to 11.3 too ... this problem fix is expected in 11.3-U2
 

tonci

Dabbler
Joined
Mar 14, 2013
Messages
18
This was not only robocopy issue , but pure copy/paste drag&drop resulted the same ... original timestamp was never preserved ... 11.3 is handlong this correctly
 

andrewd

Cadet
Joined
Feb 22, 2020
Messages
2
I have also noticed this problem in 11.3-U1 when doing a copy using the File Explorer. Date Modified is set to the date of the copy. I am pretty sure this was working in 11.3.

I couldn't find a Jira ticket covering the issue, but I just found a related thread, where @anodos from iXsystems says the problem will be fixed in 11.3-U2. There is also a patch mentioned early in the thread. (I think I read somewhere that 11.3-U2 is due at the end of March.)
 

LokaMike

Cadet
Joined
Dec 14, 2019
Messages
1
I use the below script for just copies the new files and changed files and it works fine

@echo off
:: Incremental_Backup.bat Created by DA
:: It is a total copy first and then incrementally,
:: ie, it just copies the new files and changed files.
mode con cols=95 lines=5 & color 0E
Title %~nx0 for Incremental Backup with XCopy Command by DA
set "Settings=%~dp0Settings.ini"
Set "FirstFull_CopyLog=%~dp0%~n0_FirstFull_CopyLog.txt"
Set "LogFile=%~dp0%~n0_Incremental_CopyLog.txt"
If not exist "%Settings%" (
Call :BrowseForFolder "Please choose the source folder for the backup" SourceFolder
Setlocal EnableDelayedExpansion
If defined SourceFolder (
echo(
echo You chose "!SourceFolder!" as source folder
) else (
echo(
Color 0C & echo The source folder is not defined ... Exiting ......
Timeout /T 2 /nobreak>nul & exit
)
Call :BrowseForFolder "Please choose the target folder for the backup" TargetFolder
If defined TargetFolder (
echo(
echo You chose "!TargetFolder!" as Target folder
) else (
echo(
Color 0C & echo The Target folder is not defined ... Exiting ......
Timeout /T 2 /nobreak>nul & exit
)
Timeout /T 3 /nobreak>nul
(
echo "!SourceFolder!"
echo "!TargetFolder!\Backups_%ComputerName%\"
)
cls & echo( & echo(
echo Please wait a while ... The Backup to "!TargetFolder!" is in progress...
Call :Backup_XCopy "!SourceFolder!" "!TargetFolder!" "!FirstFull_CopyLog!"
Timeout /T 1 /nobreak>nul
Start "" "!FirstFull_CopyLog!" & exit
) else (
Setlocal EnableDelayedExpansion
for /f "delims=" %%a in ('Type "%Settings%"') do (
set /a idx+=1
set Param[!idx!]=%%a
)

Set "SourceFolder=!Param[1]!"
Set "TargetFolder=!Param[2]!"
echo(
echo The source Folder from Settings.ini is : !SourceFolder!
echo The Target Folder from Settings.ini is : !TargetFolder!
Timeout /T 1 /nobreak>nul & cls & echo( & echo(
echo Please wait a while ... The Backup to !TargetFolder! is in progress...
Call :Backup_XCopy !SourceFolder! !TargetFolder! !LogFile!
)
Timeout /T 1 /nobreak>nul
Start "" !LogFile! & exit
::****************************************************************************
:BrowseForFolder
set "psCommand="(new-object -COM 'Shell.Application')^
.BrowseForFolder(0,'%1',0,0).self.path""
for /f "usebackq delims=" %%I in (`powershell %psCommand%`) do set "%2=%%I"
exit /b
::****************************************************************************
:Backup_XCopy <Source> <Target> <LogFile>
Xcopy /c /d /e /s /i /y %1 %2 > %3 2>&1
Exit /b
::****************************************************************************

this script if you like coding and scripts, also there are GUI alternatives to robocopy that can do this job without any problems or consuming much time in coding, peer sync , gs richcopy360 and securecopy quest as an example.

for me, I prefer GUI SWs
 
Top