Mir will delete it all if it's not there anymore. So generally better not to use it (imo).
Originally Posted by edutech4schools
This is one of my personal ones I use on my nas:
Obviously can remove the bits you don't want, but:
robocopy C:\ "\\MYNAS\StevePC\%date:/=-% C Backup" /M /S /R:2 /W:2 /XJ /B /XF *thumbs.db* *ntuser.dat* "C:\pagefile.sys" "C:\hiberfil.sys" /XD "$RECYCLE.BIN"
/M removes archive bits, aka makes it incremental so only copies things that change
/S copy subfolders too
/R:2 retries on fails
/W:2 wait seconds between retries
/XJ ignores junction points (aka if you had a shortcut to another drive, it won't go off and copy that drive too
/B use backup mode for files that normally you can't access
/XD/XF exclude files/folders you don't want copied
-Edit noticed you said logging too:
/LOG:filename <- makes log
/TEE shows log in command prompt and output (but don't need that really)
/NDL ignores directorys in terms of logging, else it'll spam you all then time
Edit 2 - My whole one:
robocopy C:\ "\\MYNAS\StevePC\%date:/=-% C Backup" /LOG:"\\MYNAS\StevePC\%date:/=-% C Backup\Log.txt" /TEE /NDL /M /S /R:0 /W:2 /XJ /B /XF *thumbs.db* *ntuser.dat* "C:\pagefile.sys" "C:\hiberfil.sys" /XD "$RECYCLE.BIN" "System Volume Information" "ProgramData" "C:\Windows" "C:\Program Files" "C:\Program Files (x86)" *Temporary* "C:\Boot" "C:\Users\Steve\Appdata"