I have a script that performs a delayed synchronisation of data files from an industrial pc running Windows XP to a NAS box (QNAP TS-110). I have been testing this script on my computer (also running XP [-pro 2002 S.P.3]), with the NAS mounted as a network drive (192.168.10.122 -> Z:\).
I have run the script sequentially to make sure it behaves as expected. My "test" folder contains a few sub directories and a number of files of different types. However, from a reading of my "Log.txt" file, while it copies most files from my "test" folder only once, some files it copies repeatedly. On a colleague's computer (also XP pro) it consistently copied a number of .jpg files, on mine it consistently copies one .txt file.
As far as I can tell, there does not appear to be any pattern to this behaviour. We have tried tweaking the clock on the NAS to see if this makes any difference, but to no avail. We have also tried various combinations of the switches to see if some interaction between them is causing the unexpected behaviour, but this has not worked either.
We have considered installing a version of RoboCopy and using that, but I am kinda hoping that this will not be necessary, and that I have just missed something simple.
My code is:
@echo off
title NAScopy02
REM note: Timeout.exe must be in the same directory as this file to work correctly!
REM (1)
Timeout 5
set today=%date%
REM (2)
ping 192.168.10.122 -n 1 | find /i "bytes=" || goto Fail01
set now=%time%
echo %today%, %now%, 192.168.0.122 >> "Log.txt
xcopy test Z:\test01 /D /E /I /H /Y >> "Log.txt
:Fail01
REM (3)
ping 192.168.10.1 -n 1 | find /i "bytes=" || goto Fail02
set now=%time%
echo %today%, %now%, 192.168.0.12 >> "Log.txt
xcopy test test01 /DEIHY >> "Log.txt
:Fail02
REM (4)
ping 192.168.10.1 -n 1 | find /i "bytes=" || goto Fail03
set now=%time%
echo %today%, %now%, 192.168.0.13 >> "Log.txt
xcopy test test01 /DEIHY >> "Log.txt
:Fail03
REM : use loops!
@echo on
My Log.txt reads:
27/07/2011, 17:51:41.65, 192.168.0.11
test\2011 06 22 0000 (Float).DAT
test\test_files\DSC_2074.JPG
test\test_files\DSC_2077.JPG
test\test_files\DSC_2081.JPG
test\test_files\DSC_2083.JPG
test\test_files\DSC_2084.JPG
test\test_files\DSC_2096.JPG
test\test_files\DSC_2099.JPG
test\test_files\subfolder1\Subfolder1dash1\yo_mama.txt
test\test_files\test files 2\DSC_2074.JPG
test\test_files\test files 2\DSC_2077.JPG
test\test_files\test files 2\DSC_2081.JPG
test\test_files\test files 2\DSC_2083.JPG
test\test_files\test files 2\DSC_2084.JPG
test\test_files\test files 2\DSC_2096.JPG
test\test_files\test files 2\DSC_2099.JPG
test\test_files\test_folder\test.txt
17 File(s) copied
27/07/2011, 17:51:59.72, 192.168.0.12
0 File(s) copied
27/07/2011, 17:52:00.06, 192.168.0.13
0 File(s) copied
27/07/2011, 17:53:16.19, 192.168.0.11
test\2011 06 22 0000 (Float).DAT
1 File(s) copied
27/07/2011, 17:53:16.69, 192.168.0.12
0 File(s) copied
27/07/2011, 17:53:17.01, 192.168.0.13
0 File(s) copied
27/07/2011, 17:53:27.06, 192.168.0.11
test\2011 06 22 0000 (Float).DAT
1 File(s) copied
27/07/2011, 17:53:27.51, 192.168.0.12
0 File(s) copied
27/07/2011, 17:53:27.83, 192.168.0.13
0 File(s) copied
Any help with this (now frustrating) problem would be Appreciated.
Dan