Hi Robocopy专家, 我无法使用以下批处理文件从Windows XP SP3工作站使用robocopy将备份文件传输到服务器:
@echo off
………..
set "LOCAL_BACKUP_PATH=H:\Backup\%LOCALDATESTAMP%"
set "REMOTE_BACKUP_PATH=X:\Backup\%REMOTEDATESTAMP%"
md "H:\Backup\%DATESTAMP%" 2 > nul
rem "%ProgramFiles%\7-Zip\7z.exe" a -tzip "%LOCAL_BACKUP_PATH%\%BACKUP_FILE%" "H:\Backup\%LOCALDATESTAMP%\Images.db" "H:\Backup\%LOCALDATESTAMP%\Images.log" >> "H:\Backup\blog.txt"
c:\robocopy\robocopy.exe "%LOCAL_BACKUP_PATH%" "%REMOTE_BACKUP_PATH%" "%BACKUP_FILE%" /COPY:DATS /w:1 >> "H:\Backup\blog.txt"
以下是robocopy输出:
----------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows :: Version XP010
----------------------------------------------------------------------------
Started : Thu Dec 29 18:00:22 2017
Source = H:\Backup\171229_1800\
Dest : X:\Backup\171229\
Files : Backup_171229180022.zip
Options : /COPY:DATS /R:1000000 /W:1
----------------------------------------------------------------------------
NOTE: NTFS Security may not be copied - Source may not be NTFS.
0 H:\Backup\171229_1800\
----------------------------------------------------------------------------
Total Copied Skipped Mismatch FAILED Extras
Dirs : 1 0 1 0 0 0
Files : 0 0 0 0 0 0
Bytes : 0 0 0 0 0 0
Times : 0:00:00 0:00:00 0:00:00 0:00:00
Ended : Thu Dec 29 18:00:22 2017
从Windows 7 Pro w / s转移到源文件夹来自NTFS卷(Robocopy kept adding backslash in Windows 7 batch script)的同一服务器时,此设置有效。
以下是Windows 7 Pro设置与此之间的差异:
我没有想法,非常感谢您的专业建议。 再次感谢, 乔治
答案 0 :(得分:0)
Robocopy正确显示输出。 您的robocopy输出显示它没有找到具有此名称的文件,这就是没有文件被复制的原因。
Total Copied Skipped Mismatch FAILED Extras
Dirs : 1 0 1 0 0 0
Files : 0 0 0 0 0 0
在提交Robocopy以复制任何内容之前,请确保此文件存在。否则,在日志文件中给出一条消息,指出该文件不存在。
if exist "%LOCAL_BACKUP_PATH%\%BACKUP_FILE%" (
robocopy ...
) else >> "H:\Backup\blog.txt echo "%LOCAL_BACKUP_PATH%\%BACKUP_FILE%" not found.