2013-04-03 39 views
1

我無法使robocopy的/保存和/作業選項正常工作。其實,/保存選項似乎工作:robocopy /保存和/作業選項

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使用作業文件它剛剛創建?

回答

1

當您在命令行和.rcj文件中指定源/目標時,可能會發生/ job的「無效參數」。

1

您必須避免robocopy作業文件位於網絡共享上。請注意作業的文件名和文件的結尾。

命令行應該是: ROBOCOPY /JOB:"driveletter:-yourjobname-.rcj」