I am trying to copy files from Server1 to Server2.<\/p>\n
Here is what I have, and I’m running it from Server2: robocopy \\server1\\data d:\\data /e /s /copyall /dcopy:t /xd “$RECYCLE.BIN” /w:0 /r:0<\/p>\n
however, even with the /xd switch it seems to want to copy the recycle bin files. Am I doing something wrong?<\/p>\n
Also, I want to copy all of the files over and then run a mirror command. going to transfer the bulk of the data over now then next week run a /mir and decomisssion the old server. running the /MIR command scares me though because it says it can also delete data. in which case will it do that?<\/p>\n
And with /copyall, this should retain NTFS permissions right? Server2 is going to go on the domain.<\/p>\n
thanks for your help.<\/p>","upvoteCount":4,"answerCount":7,"datePublished":"2017-04-06T19:05:41.000Z","author":{"@type":"Person","name":"td5","url":"https://community.spiceworks.com/u/td5"},"acceptedAnswer":{"@type":"Answer","text":"\n\n
<\/div>\n
td5:<\/div>\n
\nHere is what I have, and I’m running it from Server2: robocopy \\server1\\data d:\\data /e /s /copyall /dcopy:t /xd “$RECYCLE.BIN” /w:0 /r:0<\/p>\n<\/blockquote>\n<\/aside>\n
You don’t need /s if you are using /e.<\/p>\n
The recycle bin on Sever is “recycler” not recycle.bin<\/p>\n\n\n
<\/div>\n
td5:<\/div>\n
\nAnd with /copyall, this should retain NTFS permissions right? Server2 is going to go on the domain.<\/p>\n<\/blockquote>\n<\/aside>\n
Yes, that’s what copyall is for.<\/p>","upvoteCount":1,"datePublished":"2017-04-06T19:38:06.000Z","url":"https://community.spiceworks.com/t/robocopy-syntax-help-skip-files-and-mirror/572419/3","author":{"@type":"Person","name":"DragonsRule","url":"https://community.spiceworks.com/u/DragonsRule"}},"suggestedAnswer":[{"@type":"Answer","text":"
I am trying to copy files from Server1 to Server2.<\/p>\n
Here is what I have, and I’m running it from Server2: robocopy \\server1\\data d:\\data /e /s /copyall /dcopy:t /xd “$RECYCLE.BIN” /w:0 /r:0<\/p>\n
however, even with the /xd switch it seems to want to copy the recycle bin files. Am I doing something wrong?<\/p>\n
Also, I want to copy all of the files over and then run a mirror command. going to transfer the bulk of the data over now then next week run a /mir and decomisssion the old server. running the /MIR command scares me though because it says it can also delete data. in which case will it do that?<\/p>\n
And with /copyall, this should retain NTFS permissions right? Server2 is going to go on the domain.<\/p>\n
thanks for your help.<\/p>","upvoteCount":4,"datePublished":"2017-04-06T19:05:41.000Z","url":"https://community.spiceworks.com/t/robocopy-syntax-help-skip-files-and-mirror/572419/1","author":{"@type":"Person","name":"td5","url":"https://community.spiceworks.com/u/td5"}},{"@type":"Answer","text":"\n\n
<\/div>\n
td5:<\/div>\n
\nrunning the /MIR command scares me though because it says it can also delete data. in which case will it do that?<\/p>\n<\/blockquote>\n<\/aside>\n
It will remove any folders on the destination that do not exist on the source, because it’s creating an exact mirror image. If the destination is blank there’s nothing to worry about. If the destination has a previous copy of the source and a folder is deleted from the source, when you run /MIR again that deleted folder will get deleted from the destination, too.<\/p>","upvoteCount":1,"datePublished":"2017-04-06T19:32:38.000Z","url":"https://community.spiceworks.com/t/robocopy-syntax-help-skip-files-and-mirror/572419/2","author":{"@type":"Person","name":"DragonsRule","url":"https://community.spiceworks.com/u/DragonsRule"}},{"@type":"Answer","text":"
thanks a lot!<\/p>\n
i still seem to be having some trouble with the robocopy /xd command. Right now I have:<\/p>\n
robocopy \\server1\\data d:\\data /e /copyall /dcopy:t /xd “$RECYCLE.BIN” “recycler” “recycled” /w:0 /r:0<\/p>\n
but it still seems to be copying the files from the recycle bin. I cannot even see those files on the source drive so it must be hidden.<\/p>\n
did I miss something? i guess if I need to copy those that is not the end of the world but was just hoping to save on time.<\/p>\n
much appreciated<\/p>","upvoteCount":0,"datePublished":"2017-04-07T11:48:59.000Z","url":"https://community.spiceworks.com/t/robocopy-syntax-help-skip-files-and-mirror/572419/4","author":{"@type":"Person","name":"td5","url":"https://community.spiceworks.com/u/td5"}},{"@type":"Answer","text":"
Maybe try it with the full path? “d:\\recycler” or whatever the appropriate drive letter is.<\/p>","upvoteCount":0,"datePublished":"2017-04-07T11:53:32.000Z","url":"https://community.spiceworks.com/t/robocopy-syntax-help-skip-files-and-mirror/572419/5","author":{"@type":"Person","name":"DragonsRule","url":"https://community.spiceworks.com/u/DragonsRule"}},{"@type":"Answer","text":"
wow, I feel a little silly now… problem is that I was using powershell and it sees $ as a variable! Duh… working much better via command prompt. thanks!<\/p>","upvoteCount":1,"datePublished":"2017-04-07T13:16:05.000Z","url":"https://community.spiceworks.com/t/robocopy-syntax-help-skip-files-and-mirror/572419/6","author":{"@type":"Person","name":"td5","url":"https://community.spiceworks.com/u/td5"}},{"@type":"Answer","text":"
LOL. It’s amazing the small things that can mess you up.<\/p>","upvoteCount":0,"datePublished":"2017-04-07T13:24:56.000Z","url":"https://community.spiceworks.com/t/robocopy-syntax-help-skip-files-and-mirror/572419/7","author":{"@type":"Person","name":"DragonsRule","url":"https://community.spiceworks.com/u/DragonsRule"}}]}}
td5
(td5)
April 6, 2017, 7:05pm
1
I am trying to copy files from Server1 to Server2.
Here is what I have, and I’m running it from Server2: robocopy \server1\data d:\data /e /s /copyall /dcopy:t /xd “$RECYCLE.BIN” /w:0 /r:0
however, even with the /xd switch it seems to want to copy the recycle bin files. Am I doing something wrong?
Also, I want to copy all of the files over and then run a mirror command. going to transfer the bulk of the data over now then next week run a /mir and decomisssion the old server. running the /MIR command scares me though because it says it can also delete data. in which case will it do that?
And with /copyall, this should retain NTFS permissions right? Server2 is going to go on the domain.
thanks for your help.
4 Spice ups
It will remove any folders on the destination that do not exist on the source, because it’s creating an exact mirror image. If the destination is blank there’s nothing to worry about. If the destination has a previous copy of the source and a folder is deleted from the source, when you run /MIR again that deleted folder will get deleted from the destination, too.
1 Spice up
You don’t need /s if you are using /e.
The recycle bin on Sever is “recycler” not recycle.bin
Yes, that’s what copyall is for.
1 Spice up
td5
(td5)
April 7, 2017, 11:48am
4
thanks a lot!
i still seem to be having some trouble with the robocopy /xd command. Right now I have:
robocopy \server1\data d:\data /e /copyall /dcopy:t /xd “$RECYCLE.BIN” “recycler” “recycled” /w:0 /r:0
but it still seems to be copying the files from the recycle bin. I cannot even see those files on the source drive so it must be hidden.
did I miss something? i guess if I need to copy those that is not the end of the world but was just hoping to save on time.
much appreciated
Maybe try it with the full path? “d:\recycler” or whatever the appropriate drive letter is.
td5
(td5)
April 7, 2017, 1:16pm
6
wow, I feel a little silly now… problem is that I was using powershell and it sees $ as a variable! Duh… working much better via command prompt. thanks!
1 Spice up
LOL. It’s amazing the small things that can mess you up.