robocopy / save和/ job options

时间:2013-04-03 16:22:00

标签: robocopy

我无法让robocopy的/ save和/ job选项正常工作。实际上/ save选项似乎有效:

robocopy c:\temp c:\tmp *.out /save:c:\tmp\rob1 /L
-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows     ::     Version XP010
-------------------------------------------------------------------------------
  Started : Wed Apr 03 11:36:48 2013
   Source : c:\temp\
     Dest : c:\tmp\
    Files : *.out

  Options : /L /COPY:DAT /R:1000000 /W:30
------------------------------------------------------------------------------
                       1    c:\temp\
      *EXTRA File              188    cd.out
      *EXTRA File            23126    dmidecode.out
      *EXTRA File             3102    foo.out
------------------------------------------------------------------------------
                Total    Copied   Skipped  Mismatch    FAILED    Extras
     Dirs :         1         0         1         0         0         0
    Files :         1         0         1         0         0         3
    Bytes :     1.0 k         0     1.0 k         0         0    25.7 k
    Times :   0:00:00   0:00:00                       0:00:00   0:00:00
    Ended : Wed Apr 03 11:36:48 2013

但是,当我尝试使用刚生成的作业文件时,出现错误:

robocopy c:\temp c:\tmp *.out /job:c:\tmp\rob1 /L
Job File : C:\TMP\ROB1.RCJ
ERROR : Invalid Job File, Line #11 :"/SD:c:\temp\"
-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows     ::     Version XP010
-------------------------------------------------------------------------------
  Started : Wed Apr 03 11:37:08 2013
   Source - c:\temp\
     Dest - c:\tmp\
    Files : *.out

  Options : /JOB /COPY:DAT /R:1000000 /W:30
------------------------------------------------------------------------------
ERROR : Invalid Parameter #4 : "/job:c:\tmp\rob1"
       Simple Usage :: ROBOCOPY source destination /MIR
             source :: Source Directory (drive:\path or \\server\share\path).
        destination :: Destination Dir  (drive:\path or \\server\share\path).
               /MIR :: Mirror a complete directory tree.
    For more usage information run ROBOCOPY /? or read Robocopy.Doc.
NOTE: Read "True Replication" in Robocopy.Doc prior to first use of /MIR !
****  /MIR can DELETE files as well as copy them !

为什么robocopy不能使用它刚刚创建的作业文件?

2 个答案:

答案 0 :(得分:1)

在命令行和.rcj文件中指定源/目标时,可能会发生/ job的“无效参数”。

答案 1 :(得分:1)

您必须避免robocopy作业文件位于网络共享上。请注意作业的文件名和文件的结尾。

命令行应该是: robocopy / JOB:" driveletter:-yourjobname-.rcj"