Saya mencoba menggunakan robocopy di dalam powershell untuk mencerminkan beberapa direktori di mesin rumah saya. Ini skrip saya:
param ($configFile)
$config = Import-Csv $configFile
$what = "/COPYALL /B /SEC/ /MIR"
$options = "/R:0 /W:0 /NFL /NDL"
$logDir = "C:\Backup\"
foreach ($line in $config)
{
$source = $($line.SourceFolder)
$dest = $($line.DestFolder)
$logfile = $logDIr
$logfile += Split-Path $dest -Leaf
$logfile += ".log"
robocopy "$source $dest $what $options /LOG:MyLogfile.txt"
}
Script mengambil file csv dengan daftar direktori sumber dan tujuan. Ketika saya menjalankan skrip saya mendapatkan kesalahan ini:
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : Sat Apr 03 21:26:57 2010
Source : P:\ C:\Backup\Photos \COPYALL \B \SEC\ \MIR \R:0 \W:0 \NFL \NDL \LOG:MyLogfile.txt\
Dest -
Files : *.*
Options : *.* /COPY:DAT /R:1000000 /W:30
------------------------------------------------------------------------------
ERROR : No Destination Directory Specified.
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 /?
**** /MIR can DELETE files as well as copy them !
Adakah yang harus saya lakukan untuk memperbaikinya?
Terima kasih, Mark.