SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from Fedora 25 dcp-1.0.6-1.fc25.x86_64.rpm

DCP

Section: User Commands (1)
Index 

NAME

dcp - copy and profile files and directories 

SYNOPSIS

dcp[OPTION]... [-h PATH][-o PATH] SOURCE DEST 

DESCRIPTION

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. 

OPTIONS

-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 #)
 

ENVIRONMENT

dcp responds to the following Environment variables. When parsingprecedence is as follows cmd line args > envi vars > default vals.
DCP_OWNER
if set the username that all new files and directories will belong, overriddenby -O/--owner
DCP_GROUP
if set the group name that all new files and directories will belong,overridden by -G/--group
DCP_CACHE_SIZE
How much memory should be set aside for caching files in memory, ignored if -c/--cache-size is set
 

INPUT

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. 

OUTPUT FORMAT

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

FILE_FAILED
Processing failed, see dcp's error output for more information.
FILE_COPIED
dcp successfully copied the file to the specified destination.
DIR_CREATED
Successfully created the directory.
DIR_FAILED
An error occured attempting to create the directory.
SYMLINK_CREATED
Successfully copied the symlink.
SPECIAL_CREATED
Successfully copied a block, character, socket or fifo file.
 

CACHE SIZE

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', 

EXAMPLES

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


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
ENVIRONMENT
INPUT
OUTPUT FORMAT
CACHE SIZE
EXAMPLES
SEE ALSO
OUTPUT JSON SCHEMA

This document was created byman2html,using the manual pages.