Try here : Simple file synchronization using robocopy
I am total useless at robocopy syntax. I always end up with multiply commands that all seem to do the same thing. I do have the list of switches but would like some help.
What I simply need is to copy the contents from one folder to another without it wiping the destination first and just to copy any new or updated files and log any problems.
should I use the /mir or something else?
This is one of my personal ones I use on my nas:
Obviously can remove the bits you don't want, but:Code: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:
SteveCode: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"
Last edited by Steve21; 7th May 2012 at 02:26 PM.
Download Richcopy instead - same thing but with an easy to use GUI
ACLs would be handy for work but RichCopy might be what I need for home.
Is that not what you would want? If I delete a folder on the source it will delete it on the destination. or have I missed your point?Mir will delete it all if it's not there anymore. So generally better not to use it (imo)
There are currently 1 users browsing this thread. (0 members and 1 guests)