next up previous contents
Next: deleteFile Up: Management Commands Previous: bulkCopyAndRegisterFile   Contents

replicateFile

Command: replicateFile
Description: Replicate a file to another SE.
Arguments: sourceFileName The file to replicate. This may be an LFN, GUID or SURL. For LFN and GUID the best SURL is found through listBestFile. If the destination SE is omitted, the file is replicated to the local SE, i.e. it's the same as getBestFile.
Options: -d or - -destination destination-SURL or SE host
  -p or - -protocol protocol
  -n or - -streams number of streams
Example: edg-replica-manager -vo=wpsix replicateFile lfn:mydata -d lxshare0384.cern.ch

COMMAND LINE TOOL

usage: edg-replica-manager replicateFile sourceFileName [options]
Replicate a file to another SE.
 -d,--destination <file>    The destination to replicate to. This may be a
                            fully qualified SURL, just an SE host name or
                            just be omitted - in which case the replication
                            will be done to the closest SE.
 -n,--streams <#streams>    The number of parallel streams to use if
                            supported by protocol. Optional.
 -p,--protocol <protocol>   The protocol to be used for the transfer
                            (optional).
 Arguments:
  sourceFileName        The file to replicate. This may be an LFN, GUID or
                        SURL. For LFN and GUID the best SURL is found through
                        listBestFile. If the destionation SE is omitted,
                        the file is replicated to the local SE, i.e. it's
                        the same as getBestFile.

The replicateFile call performs the task of replicating a file between grid-aware stores and registering the replica in the Replica Catalog as an atomic operation. This is the preferred method to `copy files around in the grid'.

The difference to copyAndRegisterFile is that this operation only allows for GUID, LFN or SURL as the source file whereas copyAndRegisterFile explicitly forbids that. No new GUID is generated for the replica (hence the term).

Semantics

replicateFile also handles all the possible failures if the registration should fail after the copy has taken place. If the remote site already contains a replica, this operation returns successfully very quickly.

Since replication can only be done between Storage Elements, both sourceFileName and destination must refer to a Storage Element (unless one uses LFN or GUID as the argument for the sourceFileName without further options).

The method returns the SURL of the new replica upon success or an appropriate error message upon failure.

Arguments

sourceFileName
The file to be registered. The sourceFileName may be:

Options

destination-file
The physical destination may be specified in three different ways:
protocol
The protocol to be used. If it is omitted, the default protocol for the given SE is used.

streams
The number of parallel streams to be used for the copy. If omitted, the default is used for the given protocol.

Return value

The call returns 0 on success and -1 on failure. It also prints the SURL of the new replica.

Errors

The call can fail for many reasons. Some of the reasons are:


next up previous contents
Next: deleteFile Up: Management Commands Previous: bulkCopyAndRegisterFile   Contents
2004-06-14