windows - Robocopy Parametre Indstillinger

Indlæg af Hanne Mølgaard Plasc

Problem



Jeg vil kopiere med robocopy en mappe og hans undermapper.


Jeg vil udelukke nogle undermapper og alle filer i rodmappen.


Nu kopierer jeg katalogerne i forskellige job, men jeg vil kun have ét job


$roboOptions = @("/e", "/xo", "/r:2", "/w:2", "/log+:$logFile")

#* Copy to Share2

# &robocopy $buildDrop $copyTargetMaster $roboOptions


#* Copy Share1

&robocopy   $buildDrop"Client" $copyTarget"Client" $roboOptions
&robocopy   $buildDrop"Database" $copyTarget"Database" $roboOptions
&robocopy   $buildDrop"dbscripts" $copyTarget"dbscripts" $roboOptions
&robocopy   $buildDrop"EA" $copyTarget"EA" $roboOptions
&robocopy   $buildDrop"Jobs" $copyTarget"Jobs" $roboOptions
&robocopy   $buildDrop"
eplication" $copyTarget"
eplication" $roboOptions
&robocopy   $buildDrop"server" $copyTarget"server" $roboOptions


Hvordan kan jeg gøre dette?

Bedste reference


Sådan gør jeg det:


@ECHO off
>nul 2>nul robocopy
if errorlevel 9009 (
  ECHO ROBOCOPY is not installed.
) else (
  ECHO Starting 1-way backup of MEDIA(M:) to BACKUP(G:)...
    robocopy.exe M: G: *.* /E /PURGE /SEC /NP /NJH /NJS^
 /XD "$RECYCLE.BIN" "System Volume Information" /TEE /R:5 /COPYALL^
 /LOG:from\_MEDIA\_to\_BACKUP.log
  ECHO Finished with backup.
)    
pause