•
0 if files have been copied correctly or if another instance of gcp is already running and will do the copy.
Advanced command-line file copier
gcp [OPTIONS]
FILE
DEST
gcp [OPTIONS]
FILE1
[FILE2 ...]
DEST-DIR
gcp is a file copier, loosely inspired by cp, but with high level functionalities like:
transfer progression indication
continuous copying when there is an issue: it skips the problematic file and goes on
copy status logging: which files were effectively copied
name mangling to handle target filesystem limitations (e.g. removing incompatible chars like "?" or "*" on FAT filesystems)
forced copy serialization: new files to copy are added to a global queue to avoid hard drive head seeks
transfer list management: gcp can save a list of files to copy and reuse it later
approximate option compatibility with cp (approximate because the behaviour is not exactly the same, see below)
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-').
A summary of options is included below.
-h, --help
Show summary of options.
-V, --version
Show program version and copyright information and exit.
-f, --force
Overwrite existing files.
-L, --dereference
Always follow symbolic links in sources.
-P, --no-dereference
Never follow symbolic links in sources.
-p
Same as --preserve=mode,ownership,timestamps
--preserve=<attributes>
Preserve specified attributes. Attributes can be mode, ownership and timestamps. When several attributes are passed, they need to be separated by commas. Please note that timestamps preservation has some limits, see section LIMITATIONS.
-r, -R, --recursive
Copy directories recursively.
-v, --verbose
Display what is being done.
--fix-filenames=<force|auto|no>
gcp has the ability to modify the destination file name if the target file system would not accept the original file name. Offending characters will be replaced with similar-looking ones.
This option accept the following values:
gcp will attempt to be smart, i.e. detect incompatibilities and fix them as-needed.
Always fix file names that could cause problems on any known filesystem or OS. This is useful e.g. with NTFS, see NOTE ON NTFS below.
Renaming is disabled entirely.
Currently, gcp is only aware of FAT incompatibilities: ´\´, ´:´, ´*´, ´?´, ´"´, ´<´, ´>´ and ´|´.
--no-fs-fix (DEPRECATED)
Same as --fix-filenames=no. This option will be removed in a future release.
--no-progress
Disable progress bar.
--sources-save=SOURCES
Save the list of source files in a list named SOURCES.
--sources-replace=SOURCES
Save the list of source files in a list named SOURCES; the file is overwritten it already exists.
--sources-load=SOURCES
Use the list of source files named SOURCES.
--sources-del=SOURCES
Delete the list of source files named SOURCES.
--sources-list
List the names of source file lists.
--sources-full-list
List the names of source file lists, including their content.
The exit status can be:
•
0 if files have been copied correctly or if another instance of gcp is already running and will do the copy.
•
1 if at least one file has not been copied, or if something went wrong.
•
2 if all files have been copied but with some issues
Timestamps preservation with --preserve option is limited by the os Python module on POSIX systems. Currently, Python only returns timestamps in float format, which is a smaller precision than what POSIX provides. Progress on this issue can be seen at http://bugs.python.org/issue11457.
The --preserve option cannot currently be used without an attribute list (gcp --preserve foo bar will behave as gcp --preserve=foo bar). Use the -p switch instead.
NTFS will not enforce the same file name limitations than FAT, but files that would not be accepted on a FAT filesystem will still cause problems on Windows. Hence, it is recommended to use --fix-filenames=force when copying to NTFS (when Windows compatibility is desired, anyway).
7 releases since Debian 7 (Wheezy); the text changed 1 time.
--fix-filenames since Debian 10 (Buster);
-R since Debian 10 (Buster);
-V since Debian 10 (Buster);
-p since Debian 10 (Buster).