I used to have an xcopy script that ran this, but now I have upgraded to using robocopy to mirror my files to a network share that I disconnect and put in cold storage when not actually backing up.
robocopy E:\ \\192.168.50.30\backup\ /E /XD “System Volume Information” “$RECYCLE.BIN” “found.00*” /MIR
Break down of the script: E: is the SOURCE of my files and \\192.168.50.30\backup\ is my DESTINATION to copy TO. If you not the XD trigger, that EXCLUDES certain files. I want to ignore certain system files that do not matter to my back ups. You can do this for nearly any directory. /MIR is what actually MIRRORS the files, so they will look exactly like what you have on your SOURCE directory structure.
The only downside is there is no versioning with this, what you see is what you get, so if you were struck with some randomsware, this won’t save you. You would want something like seafile, or some other back up service. If there’s any interest, I can make a post on how to create a seafile server to do your back ups and version control. It has the added benefit of having versioning, browser accessible, and phone applications.