These two days suddenly see a demand point, need to implement the function of incremental backup, find some information
Record the following command, which enables simple incremental backup with the command line.
Win:
Copy Code code as follows:
xcopy C:\Docs d:\backup\docs/e/h/r/y/i/d
The specific value of each parameter can be referenced by xcopy/? The output result
Linux can be done through the powerful rsync command, this command is still very strong, the specific use can be a man, or Google. Of course, you can also use rsync under Windows
Description of the parameters of the Windows xcopy Backup command:
Copy files and directory trees.
XCOPY source [Destination] [/a |/M] [/d[:d ate]] [/p] [/S [/e]] [/v] [/w]
[/C] [I] [/Q] [/F] [/L] [/g] [/h] [/R] [/T] [/u]
[/k] [/n] [/O] [/x] [/y] [/-y] [/z]
[/exclude:file1[+file2][+file3] ...]
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 excludes
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.