Techniques for mass file copying and backup (xcopy command implementation) _dos/bat

Source: Internet
Author: User

There are usually more and more files on the Web server, and when a large number of files are replicated and backed up, using the copy and paste feature of Windows is very slow, the main reason is related to the calculation of the remaining time when Windows replication, which brings a lot of trouble to webmasters. I'm here to summarize a simple and fast method for mass file copying and backup.

First of all, what is Xcopy?

xcopy is a Windows self-contained tool for copying files and directories, and it is a very useful command-line tool to replicate subdirectories.

A common way to replicate a directory is to:

xcopy "D:\website" "D:\webbak"/s/e/y

For Web site Backup, we can only copy those modified files, you can use the following command:

xcopy "D:\website" "D:\webbak"/s/e/y/d

This command automatically copies the files that date changes according to the file date.

Finally, more use of the format:

XCOPY source [Destination] [/a |/M] [/d[:d ate]] [/p]
[/C] [I] [/Q] [/F] [/L] [/
[/k] [/n] [/O] [/x] [/y] [/
[/exclude:file1[+file2][+fi
SOURCE specifies the file to copy.
destination Specifies the location and/or name of the new file.
/A copies only files that have archived attribute sets.
But do not change attributes.
/M copies only files that have archived attribute sets.
and close the archive attribute.
/d:m-d-y copies files that are changed after a specified date or a specified date.
If no date is provided, only those source times are copied
A new file than the target time.
/EXCLUDE:FILE1[+FILE2][+FILE3] ...
Specifies a list of files that contain strings. Each string
Must be in a separate line of the file. If there is any
The absolute path to the string and the file to be copied
Match, that file will not be copied.
For example, specifying a string such as \obj\ or. obj will row
All files under directory obj or with
The file for the. obj extension.
/p prompts before each target file is created.
/S Copy directories and subdirectories, except for empty.
/e Copies directories and subdirectories, including empty.
Same as/s/e. Can be used to modify/T.
/V verifies each new file.
/w prompts you to press the key before copying.
/C Continue copying even if there are errors.
/I if the target does not exist, and is copying more than one file,
It is assumed that the target must be a directory.
/q does not display the file name when copying.
/F Displays the full source and destination file names when copying.
/L Displays the files to be copied.
/g allows files that have not been encrypted to be copied to the
The target of encryption is not supported.
/h also copies hidden and system files.
/R overwrites read-only files.
/T Creates a directory structure, but does not copy files.
Does not include an empty directory or subdirectories. /T/E includes
Empty directories and subdirectories.
/U copies only files that already exist in the target.
/k replication Properties. The general Xcopy resets the read-only property.
/n is copied with the generated short name.
/o Copy file ownership and ACL information.
/x Copy file audit settings (implied/O).
/y Copy file audit settings (implied/O).
An existing target file.
/-y causes a prompt to confirm the overwrite of a
An existing target file.
/z The network file in restart mode.
The command-line switch/y can be set in advance in the COPYCMD environment variable. This may be overwritten by the/-y on the command line.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.