Spo*_*oot 6 scheduled-tasks robocopy
我有几个任务使用Robocopy.exe,在其中一个任务中,我得到一个错误结果,0X3但日志文件没有显示任何错误。这是命令:
ROBOCOPY \\X\L$\FORMATION \\Y\O$\FORMATION /MIR /sec /W:2 /R:5 /log:c:\O_journal.log
Run Code Online (Sandbox Code Playgroud)
我试图在没有任务调度程序的情况下启动它,它运行良好,没有出现蚂蚁错误。
我知道错误0X3是:ERROR_PATH_NOT_FOUND。但是日志文件没有显示任何错误。
如果有人有任何线索或任何方法......
小智 5
这是一种标准行为,与 Robocopy 的退出代码有关:
0×00 0 No errors occurred, and no copying was done.
The source and destination directory trees are completely synchronized.
0×01 1 One or more files were copied successfully (that is, new files have arrived).
0×02 2 Some Extra files or directories were detected. No files were copied
Examine the output log for details.
0×04 4 Some Mismatched files or directories were detected.
Examine the output log. Housekeeping might be required.
0×08 8 Some files or directories could not be copied
(copy errors occurred and the retry limit was exceeded).
Check these errors further.
0×10 16 Serious error. Robocopy did not copy any files.
Either a usage error or an error due to insufficient access privileges
on the source or destination directories.
Run Code Online (Sandbox Code Playgroud)
以及它们的组合,即:0x03 = 0x02 + 0x01
有关完整说明,请参阅https://blogs.technet.microsoft.com/deploymentguys/2008/06/16/robocopy-exit-codes/。
小智 1
这是 robocopy 脚本上配置的路径的问题。我通过将根目录或主驱动器添加到源和目标来解决此问题。
注意:请确保您是两台服务器(源服务器和目标服务器)的管理员
例子:
来源:“\\192.168.1.2\e$\我的文件”
目的地:“\\192.168.1.5\d$\备份”
我提到的根目录或主驱动器是“e$”和“d$”,如上所示。如果这不包含在您的脚本中,您将在调度程序中遇到“0X3”错误,并且调度程序将无法工作。
注意:此脚本用于将文件从源同步/复制到目标。
使用的参数。/MIR /E /Z /R:5 /W:5
整个脚本是这样的:
robocopy "\\\192.168.1.2\e$\my files" "\\\192.168.1.5\d$\backup" /MIR /E /Z /R:5 /W:5
Run Code Online (Sandbox Code Playgroud)
希望这可能有所帮助。
谢谢。
西安