DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Thursday, March 1, 2018

XCOPY windows line command to copy the files to remote server


The xcopy command is used to copy one or more files and/or folders from one location to another location.
The xcopy command has many options and ability to copy all the directories, it is similar & more powerful than the traditional copy command.

SYNTAX:

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z][/EXCLUDE:file1[+file2][+file3]...]

EXAMPLE:

xcopy E:\PROD* /I/D/Y \\192.168.1.100\archbkps\* >E:remotedr_archbkps.log


/D:m-d-y    Copies files changed on or after the
            specified date.If no date is given, copies                  only those files whose source time is newer                  than the destination time.

 /I         If destination does not exist and copying                    more than one file,assumes that destination                  must be a directory.

 /-Y        Causes prompting to confirm you want to                      overwrite an
 existing destination file.

The switch /Y may be preset in the COPYCMD environment variable.

This may be overridden with /-Y on the command line.




No comments: