Moin
Wenn du einfach nur 1 Verzeichnis auf ein anderes spiegeln willst, dann benötigst Du nur den Parameter /mir.
Das sähe dann so aus: robocopy "C:\Musik" "D:\Musik" /mir
Aber Achtung: Alles in D:\Musik, was unter C:\Musik nicht existiert, wird damit auch gelöscht. Du bekommst ein Abbild des Quellverzeichnisses. Es ist also keine Synchronisation, sondern ein einfacher Spiegel.
Robocopy ist ein sehr mächtiges Tool und man kann unglaublich viel damit automatisieren, da robocopy auch (System-)Variablen nutzt.
Hier mal ein Beispiel, wie ich meinen Homeserver und meine lokalen Daten auf ein externes USB-Laufwerk sichere:
@echo off
set Quelle=\\HomeServer
set Ziel=M:
robocopy "%USERPROFILE%" "%Ziel%%HOMEPATH%" /mir /xj /xf ntuser.* /xd "AppData" "Contacts" "Links" "Searches" "Tracing" "Virtual Machines"
robocopy "%LOCALAPPDATA%\MediaMonkey" "%Ziel%%HOMEPATH%\AppData\Local\MediaMonkey" /mir
robocopy "%LOCALAPPDATA%\Microsoft\Outlook" "%Ziel%%HOMEPATH%\AppData\Local\Microsoft\Outlook" /if "Outlook.pst"
robocopy "%APPDATA%\Microsoft\Signatures" "%Ziel%%HOMEPATH%\AppData\Roaming\Microsoft\Signatures" /mir
robocopy "%APPDATA%\Microsoft\Templates" "%Ziel%%HOMEPATH%\AppData\Roaming\Microsoft\Templates" /mir
robocopy "%Quelle%\Benutzer\Stefan" "%Ziel%\Benutzer\Stefan" /mir
robocopy "%Quelle%\Fotos" "%Ziel%\Fotos" /mir
robocopy "%Quelle%\Musik" "%Ziel%\Musik" /mir
robocopy "%Quelle%\Software" "%Ziel%\Software" /mir
robocopy "%Quelle%\Videos" "%Ziel%\Videos" /mir
Vielleicht nutzt Du dieses kleine Script ja als Anregung.
Gruß,
Stefan