You are not logged in.

#1 17 Apr 2014 19:35

ritz5
Member
Registered: 30 Mar 2014
Posts: 5

xcopy from one server to multiple servers -

Hello All,

Will this work, i have a website package with multiple files i.e .dll, .asp, .txt, .pdf, png, .jpg and the list goes on... this also includes folders and multiple sub-directories

I want to be able to copy all the folders/files with the structure to multiple servers on Windows 2003 using xcopy, i cannot test this properly only on my local machine which is Windows 7.

However the destination folder has more folders/files and the below is the code i have to copy from one server to multiple servers. I want to keep the folders/files that are already in the destination server that is not in the new_code folder.

xcopy "D:\Server1\new_code\*.* "\\Server11\D$\code" /y /e /r >"CopyCode.log"

and would i need the "/d" switch?

I want to be able to run this from Server1 to Server10

And just to be sure is this switch "*.*" new files only?

Offline

#2 18 Apr 2014 08:07

foxidrive
Member
Registered: 04 Apr 2013
Posts: 339

Re: xcopy from one server to multiple servers -

You can test the copy by using two folders on your hard drive. 

In the target folder you can put a bunch of files and folders which emulate the files/folders that are already in the server folder.

xcopy "D:\folder1\new_code\*.*"  "D:\folder2\target\" /s/h/e/k/f/c

The /d switch is used to copy a range of files by date.  You don't need it in the way you have described.

The filespec *.* means all files.  The /h switch means to include hidden files too.

This shows you the help screen for xcopy:

xcopy /?

Last edited by foxidrive (18 Apr 2014 08:10)

Offline

#3 18 Apr 2014 12:15

ritz5
Member
Registered: 30 Mar 2014
Posts: 5

Re: xcopy from one server to multiple servers -

thank you, thats very use full what you have provided.

yes i will have to give it ago i guess i'm just curious about if xcopy will work from one server to another all in the same network so i do not see why it shouldn't.

about ignoring the errors i think i will just have it also point to a log file, is there a way of having a log file include the source and destination so i can easily reference any files?

Offline

Board footer

Powered by