Basic usage of xrdcp
xrdcp is a tool to copy files or directories from/to Xrootd.
It's basic syntax is similar to the Unix cp program.
except that the srcUrl or the trgUrl or both must be a xrootd path name url.
For example, to copy the local file, /test/f1 to xrootd with name /test/d1/f1:
xrdcp /test/f1 root://<xrootdSrv>//test/d1/f1 # copy local file to xrootd
xrdcp root://<xrootdSrv>//test/d1/f1 /tmp/f1 # copy a file from xrootd to local disk
xrdcp root://<xrootdSrv1>//test/file1 root://<xrootdSrv1>//test/file1 # copy a file from one xrootd server to another using the same file name
A xrootd has the following format:
root://servername[.domainname][:port]/<filepath>
e.g.: root://bbr-rdr01.slac.stanford.edu:1094//store/PR/AllEvents.root
If port is omitted the default (1094) is used. If the domain is omitted the local domain name is used.
- If a file is copied into xrootd the path of the file, if it does not exist on the data server, will be automatically created by xrdcp.
- If a target file already exists xrdcp will fail.
- The -f option is used to overwrite an existing file. If -f is used and the targt file does not exist xrdcp will behave as if no -f has been specified. The path will be created on the data server and the file will be copied.
- If a file is copied from xrootd to a local file system missing directories are not created. The directory for the target file has to be made prior to the transfer.
Options
Xrcdp accepts a few command line options (run xrdcp -h).
In order to control the behavior of xrdcp string and integer values can be provided to xrdcp using:
-DS<parmname> stringvalue
-DI<parmname> intvalue
where <parmname> is the parameter name. These names are specified in in the XrdClientConst.hh header file.
-DIConnectTimeout <secs>
Time the clients allows to connect to a server before it gives up. This timeout would be in affect if a server is down.
If a server is up but the xrootd daemon is not running the connection fails immediately and the client would retry.
-DIFirstConnectMaxCnt <number>
This is the number xrdcp tries to connect to a xrootd before it gives up. Between each try it waits for N seconds
settable by the ReconnectTimeout option.
-DI_ReconnectTimeout <number>
Wait time between two consecutive connection attempts.
-RequestTimeout <secs>
Time a client waits for a single response from a xrootd daemon before treating it as a missing one (i.e. go to the redirector or rebounce there).