MAN page from Fedora 28 dcp-1.0.6-1.fc28.x86_64.rpm
Section: User Commands (1)Index
dcp - copy and profile files and directories
]... [-h PATH
] SOURCE DEST
dcp combines cp, stat, md5sum and shasum to streamline mirroring and gatheringinformation about all the files copied. All information gathered is written to an output file. The output file can be fed back into dcp when copying snapshots of a directory, this allows only files which differ in location or hash to be copied.
- -a, --all
- same as -stu
- -h, --help
- Print help and exit
- -m, --md5
- calculate the md5 hash for all regular files.
- -s, --sha1
- calculate the sha1 hash for all regular files
- -t, --sha256
- calculate the sha256 hash for all regular files
- -u, --sha512
- calculate the sha512 hash for all regular files
- -o, --output=PATH
- file to write profile information to, will append if PATH exists
- -i, --input=PATH
- results from a previous run
- -O, --owner=USER
- username to chown new files to
- -G, --group=GROUP
- group name to chown new files to
- -v, --verbose
- explain what is being done
- -c, --cache-size=SIZE
- amount of memory to set aside for caching files
- -D, --debug
- when logging output debugging information (source and line #)
dcp responds to the following Environment variables. When parsingprecedence is as follows cmd line args > envi vars > default vals.
- if set the username that all new files and directories will belong, overriddenby -O/--owner
- if set the group name that all new files and directories will belong,overridden by -G/--group
- How much memory should be set aside for caching files in memory, ignored if -c/--cache-size is set
dcp can limit what files are copied by using the output of a previous run. Theidea is a previous run of sfcp copied the current partition and the current runis to copy just the differences from a snapshot of the system. Multiple input files can be specified with the -i/--input option by supplying a comma separated list or providing multiple -i args.
dcp's output is simply a newline separated file of json objects. There are twotypes of lines in the file, Metadata and file Entry. Metadata lines providecontext to how and when dcp was run, while Entries provide information onevery single file that was seen while copying.
Metadata lines are of the format "#KEY\tVALUE\n". KEY and VALUE arestrings with '\t' and '\n' escaped with "\\t" and "\\n".
File Entry lines are a json object, described below in OUTPUT JSONSCHEMA. Each file found during the copy has an entry in the output, even ifdcp cannot process it. The following states can occur
- Processing failed, see dcp's error output for more information.
- dcp successfully copied the file to the specified destination.
- Successfully created the directory.
- An error occured attempting to create the directory.
- Successfully copied the symlink.
- Successfully copied a block, character, socket or fifo file.
dcp sets aside memory to store the bytes from files that it is reading. Thelarger the buffer the fewer number of files that must be read more than once. Tocombat this dcp allows a user to set a "cache size". By default 32KiB is used.The --cache-size argument responds the following suffixes ['','b','k','m',
Use dcp to mirror the contents of 'dir1' to '/dest' while generating themd5 & sha1's for each file.
- sfcp -ms -o /dest/dir1.dcp /media/dir1 /dest/dir1 2> /backup/dir1.log
Using the results above run dcp on a snapshot 'sndir1' only copyingfiles that are different or didn't exist in main.
- sfcp -i /dest/dir1.dcp \ /media/sndir1 /dest/snapshot1 2> /backup/snapshotdir1.log
Multiple results can be specified as follows
- sfcp -i dir1.dcp -i dir2.dcp \ /media/dir3 /dest/dir3 2> /backup/part3.log
The first example above will copy all the files in 'dir1' to thedestination directory. It will store the hashes and file attributes in
- OUTPUT FORMAT
- CACHE SIZE
- SEE ALSO
- OUTPUT JSON SCHEMA
This document was created byman2html,using the manual pages.