Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Command-line reference

The same tables are available at run time, as JSON, from rcp describe.

Commands

CommandArgumentsWritesSummary
copySOURCE DESTINATIONyescopies a tree, recording every entry in a catalog
resumeyesfinishes the copy of the catalog named by -id
syncyesbrings the destination of -id back in line with its source, removing what the source dropped
isyncSOURCE DESTINATIONyessyncs without a catalog, comparing the two trees as they are
verifySOURCE DESTINATIONnocompares two trees byte for byte and reports every difference
scanSOURCEnolists a tree and reports its shape, optionally saving the listing as an index
estimateSOURCEnoprojects how long a copy would take, from a measured sample
deleteTARGETyesremoves a tree; counts only until -force
chmodTARGETyesapplies a mode across a tree
chownTARGETyesapplies an owner and group across a tree
diagSUBCOMMANDyesthe diagnostic family: file utilities, generated I/O, index diagnosis, find and change
show[HOST]nothe mounted filesystems here, or what an NFS server offers
serveyesthe far end of an ssh:// endpoint, on stdio; takes no arguments
indexlistnothe catalogs under the catalog directory
indexdeleteyesremoves the catalogs named by -id or -match
logdumpnothe job log; given an ID it also writes ID.zip in the working directory
copybatchyescopies one batch of files on a worker’s behalf (-nodes)
scanbatchnoscans one subtree on a worker’s behalf (-nodes)
jobstart|list|status|wait|cancel|log|forgetyesruns a command in a session of its own and reports on it afterwards, so a caller need not wait for a terabyte; a canceled job leaves its catalog behind, which rcp resume finishes for a copy – a sweeping verb (sync, isync) is finished by running that verb again, because resume never plans a removal
mcp[rails]noa JSON-RPC 2.0 server on stdio, so an agent host can call rcp as a tool. The server writes nothing itself; each call runs rcp as a child, which carries this server’s rails, so -readonly here makes every call read-only rather than refusing to start
describenothis description, as JSON
help[info|filters]nothe usage text
versionnothe version, the transports and what this build’s hardware offers

Endpoint schemes

SchemeSyntaxWritableSparseHard linksSymlinksXattrsACLsRenameIdentityDeltaTimesSummary
file/path or file:///pathyesyesyesyesyesyesyesyesyesnanoseconda local or mounted directory
nfshost:/export[:/sub] or nfs://host/exportyesyesyesyesyesyesyesyesyesnanosecondan NFS export reached with the built-in v3 or v4.0 client
sshssh://[user@]host[:port]/pathyesyesyesyesyesyesyesyesyesnanoseconda directory on a host that has rcp, through rcp serve over ssh
rcprcp://host:port/pathyesyesyesyesyesyesyesyesyesnanosecondthe same rcp serve, over a socket it holds with -listen; plaintext, so the serve may bind only loopback
rcpsrcps://host:port/pathyesyesyesyesyesyesyesyesyesnanosecondthe same socket inside TLS; with -tls.clientca the serve authenticates the peer, which is what lets it bind a routable address
sftpsftp://[user@]host[:port]/pathyesnoyesyesnonoyesnoyesseconda directory on a host that has only OpenSSH, through its sftp subsystem
s3s3://bucket[/prefix]yesnonoyesnonoyesnononanosecondan S3 bucket; POSIX metadata rides in user metadata
hdfshdfs://namenode:port/path or hdfs:///pathyesnononononoyesnonomillisecondan HDFS path over WebHDFS
ocioci://host[:port]/repository[:tag]yesnonononononononononea container registry’s repository as an OCI image layout
tartar://ARCHIVE[!/SUBPATH]yesyesyesyesnononoyesnonanoseconda tar archive as a tree: read any member, or write a new archive (ustar with pax headers, holes carried as GNU pax 1.0 sparse members); .tar.gz and .tar.zst are read by their magic and written by their name
smbsmb://[user@]host[:port]/share[/path]yesnononononoyesnono100-nanoseconda Windows, Samba or NAS share over SMB2 (dialects 0x0202-0x0300, NTLMv2)
davdav://host[:port]/path or davs://...yesnononononoyesnonononea WebDAV collection (Nextcloud, SharePoint, Apache mod_dav)
httphttps://host[:port]/path or http://...nononononononononosecond with rcp-index.json, none from an autoindexa web server as a READ-ONLY tree, listed from rcp-index.json, an nginx JSON autoindex or an Apache HTML one

Options

OptionKindSummary
-parallelsettingworker count, or auto[:N] for the online tuner of workers plus read and write concurrency (default: CPUs, 2 to 8)
-listensettingserve: an address to serve the protocol on (loopback, unless -tls.cert, -tls.key and -tls.clientca are all set; -allow is required)
-bssettingread and write block size (default 1m)
-enginesettingauto, uring or threads
-depthsettingstop below this depth
-bwlimitsettingread at most this many bytes a second (at least 4k)
-nodesruns a programcomma-separated hosts to spread the copy or scan over
-copybatchruns a programa program to run per batch instead of copying here
-dircountsettingNFS readdir buffer size (1k to 4m)
-catalogsafety railthe catalog directory (else RCP_CATALOG, else the state directory)
-newidsettingrecord this run under a new catalog id
-idsettingthe catalog id to resume, sync, scan from or delete
-noidsettingkeep no catalog for this run
-snappathresume or sync from this source instead of the catalog’s
-matchsettingkeep paths matching this glob (repeatable)
-excludesettingdrop paths matching this glob (repeatable)
-minsizesettingfiles at least this large
-maxsizesettingfiles at most this large
-newersettingfiles modified within this age
-oldersettingfiles untouched for this age
-typesettingf, d or l
-uidsettingfiles owned by this user
-gidsettingfiles owned by this group
-fileidsettingthe entry with this inode number
-nohashsettingno digest in the catalog; the kernel may copy the bytes
-sha256settingdigest with SHA-256 (the default)
-blake3settingdigest with BLAKE3
-xxh3settingdigest with XXH3-64, the hash rsync and rclone speak; fast and NOT cryptographic
-xxh128settingdigest with XXH3-128, the hash rsync and rclone speak; fast and NOT cryptographic
-md5settingaccepted for compatibility; the run’s digest is unchanged
-deltasettingsend a file the destination already has as a patch against it
-compresssettingcompress the payloads on an ssh:// or rcp:// stream
-compress.codecsettinglz4 (fast, the default), deflate or zstd (slower, smaller on text); implies -compress
-compress-codecsettingthe same as -compress.codec, the spelling the first zstd change used
-compress.levelsettinghow hard deflate works, 1..9 (default 6); needs -compress.codec deflate, since neither lz4 nor this crate’s zstd encoder has a level; implies -compress
-nolinkssettingcopy hard links as separate files
-noxattrsettingskip extended attributes and ACLs
-acl4settingcarry NFSv4 ACLs on NFS endpoints
-chownsettingownership must be preserved: fail otherwise
-noownsettingnever touch ownership
-preserve-atimesettingleave the source’s access times as they were
-fsyncsettingflush every file to stable storage
-nocachesettingdrop what was written from the page cache
-dryrunsettingplan and report, write nothing
-forcesettingactually remove (delete counts without it)
-removetopdirsettingremove the top directory too
-replacesettingoverwrite what is already there
-nodatasettingcompare metadata only
-noattrssettingcompare content only
-nomodssettingignore modification times
-mtimewindowsettingtolerate this many seconds of modification-time difference
-jsonsafety railthe run’s events on stdout as JSON, one object per line; human lines move to stderr
-allowsafety raila root this run may touch, repeatable; outside it every endpoint is refused before it is opened
-readonlysafety railrefuse every command that writes to an endpoint; rcp still records the run in the catalog’s jobs.log
-confirmsafety railthe plan digest a dry run printed; the run proceeds only if the plan still has that digest
-requireconfirmsafety railrefuse a run that would remove or overwrite unless -confirm matches
-vsettingone line per entry
-lsettingthe long listing
-qsettingno per-entry output
-statssettingthe statistics report
-csvsettingreport as comma-separated values
-htmlsettingreport as HTML
-fmtsettinga format string per entry
-dusettingreport sizes as du does
-duksettingreport sizes as du -k does
-edupesettingreport duplicate files
-hashcachesettingreuse a remembered digest when size, mtime and inode all still agree
-rsyncablesettingcut .tar.gz members at content-defined boundaries, so an edit does not change every later member
-nonamessettingnumeric user and group ids
-progresssettinga progress line on stderr every few seconds
-noprogresssettingno progress lines
-loglevelsettingINFO or DEBUG
-allsettingshow everything, not just the usual subset
-hsettingthe usage text
-helpsettingthe usage text
-versionsettingthe version and transports
-Vsettingthe version and transports
-samplesettinghow many bytes to read for the rate sample
-gbitsettingthe link speed to project against
-tsettinghow long a live test copy may run, or how long job wait waits
-usersettingthe user to set
-groupsettingthe group to set
-user-fromsettingonly change entries owned by this user
-group-fromsettingonly change entries owned by this group
-referencepathtake the mode or owner from this path
-modesettingthe mode to set
-rcp.remoteruns a programthe rcp to run on an ssh:// host
-viaruns a programan ssh://[user@]host[:port] or rcp://host:port whose rcp serve opens every remote endpoint of this run on its behalf
-tls.catransportthe PEM bundle an rcps:// client checks the serve’s certificate against (default: the system bundle)
-tls.certtransportthis side’s certificate chain (PEM): what a serve -listen presents, and what an rcps:// client presents when asked
-tls.keytransportthe private key for -tls.cert (PKCS#8, PKCS#1 or SEC1)
-tls.clientcatransportthe PEM bundle a serve -listen requires the peer’s certificate to come from; naming it is what turns mutual TLS on, and what lets a serve bind anything but loopback
-nfs.sectransportsys, krb5, krb5i or krb5p
-nfs.verstransport3 or 4
-hdfs.namenodeservicethe namenode for hdfs:///path
-s3.endpointservicethe S3 service to talk to
-s3.profilecredentialthe AWS profile to take credentials from
-s3.insecuretransportuse http when the S3 endpoint names no scheme
-s3.noverifytransportskip certificate verification
-oci.usercredentialUSER:PASSWORD for the registry
-dav.usercredentialUSER:PASSWORD for the WebDAV server
-smb.usercredential[DOMAIN]USER:PASSWORD for the SMB share
-smb.signsettingsign and verify every SMB message even when the server does not ask, so an edit that clears its signing bit is refused
-smb.handshaketransportseconds an SMB handshake may take before the connection is retried (default 10)
-dav.insecuretransportuse http for davs:// endpoints
-dav.noverifytransportskip certificate verification for davs:// endpoints
-http.usercredentialUSER:PASSWORD for an http:// or https:// source
-http.noverifytransportskip certificate verification for https:// sources
-http.indexpaththe published index to look for (default rcp-index.json; empty forces the autoindex readers)
-oci.insecuretransportuse http for oci:// endpoints
-oci.noverifytransportskip certificate verification for oci:// endpoints
-rmrfsettingdiag: remove this tree
-catsettingdiag: print this file
-mkdirsettingdiag: make this directory
-rmdirsettingdiag: remove this empty directory
-rmidsettingdiag: remove this catalog
-nsettingthe offset to read a job log from, and diag: how many
-rand%settingdiag: percentage of random access
-read%settingdiag: percentage of reads
-npendsettingdiag: how many operations in flight
-sizesettingdiag: how large
-usettingdiag: user
-gsettingdiag: group
-umappathdiag: user id mapping, read from this file
-gmappathdiag: group id mapping, read from this file
-atimesettingdiag: the access time to set
-mtimesettingdiag: the modification time to set
-top-matchsettingdiag: match at the top level
-branch-matchsettingdiag: match a branch
-msettingdiag: a measure argument
-jsettingdiag: a job argument
-readsettingdiag: read
-writesettingdiag: write
-randomsettingdiag: random access
-sequentialsettingdiag: sequential access
-wrdatasettingdiag: write data
-rebuildsettingdiag: rebuild the index

Events

With -json, each line on stdout is one of these events.

EventFields
entrya file, directory or symlink completed: path, kind (f|d|l), size, mtime_ns, mode, and digest when the run hashed it
removedsync removed an entry the source dropped: path
deferredthe destination will remove the entry itself, later (a registry’s garbage collector): path and why; not a failure
keptthe destination refused to remove the entry and it is still there (a lock, a namenode’s no): path and why; the run fails
differenceverify found one: kind, path, detail
warningsomething worth saying that did not fail the run: message
erroran entry or the run failed: code, message, and op and path for an entry
donethe command ended: status (passed|failed), command, and that command’s counts

Exit codes

CodeMeaning
0the command passed (STATUS: PASSED)
1the command failed (STATUS: FAILED); the events say what