SRM commands

From GridPP Wiki
Jump to: navigation, search

SRM commands

User must create a grid proxy certificate using grid-proxy-init before trying to use any of these commands. The proxy will typically be found in /tmp. The first time an srm command is executed, the file config.xml is created in the directory .srmconfig in the users homespace. This contains all of the configurable parameters that can influence the workings of srm. Command line arguments can be used to modify the default usage.


  • srmPut(). Copy file into a dCache instance. Note the four slashes in the file URL: srmcp has its own interpretation of the file scheme. In this case, transfer of files is done in *push* mode to prevent firewalls blocking access to the local disk.
 srmcp -debug=true file:////usr/lib/X11/rgb.txt \
 srm://`date +%Y%m%d_%H%M%S`.txt
  • srmGet(). Copy file out of a dCache instance. The transfer is done in *pull* mode to avoid firewalls blocking an SRM that tries to push a file into local storage. Also, the SRM will not know if there is sufficient storage space available on the local disk.
 srmcp -debug=true srm:// \
  • srmCopy(). 3rd party transfer of file between SRMs dCache instance. Both source and target SURLs must be specified. The transfer can either be made in push or pull mode (pull is default). The difference between the two transfers is described here. Essentially pull mode gives control of the transfer to the destination SRM, while push mode gives control of the transfer to the source SRM.
 srmcp -debug=true srm:// \ 
 srm://`date +%Y%m%d_%H%M%S`.txt


 srm-get-metadata \ 


dCache will mark the file as available for deletion such that it will be removed if the system needs space.

Note that as of version 1.6.6-1, dCache removes the file when it receives an advisory-delete

 srm-advisory-delete srm://



Example .srmconfig/config.xml file

Here is an example srm client configuration file. Note the location of the directories that this points the client to.

<?xml version="1.0" encoding="UTF-8"?>
        <!-- true or false-->
        <debug> false </debug>
        <!-- path to srmcp home directory -->
        <srmcphome> /opt/d-cache/srm </srmcphome>
        <!-- "globus-url-copy" or "kftp"-->
        <gsiftpclient> globus-url-copy </gsiftpclient>
        <!--true if use http over gsi over ssl for SOAP invocations
        or false to use plain http (no authentication or encryption)-->
        <gsissl> true </gsissl>
        <!-- path to the "glue" mapfile-->
        <mapfile> /opt/d-cache/srm/conf/ </mapfile>
        <!-- path to the  in the srm webservices server,
        srm/managerv1.wsdl" in case of srm in dcache-->
        <webservice_path> srm/managerv1.wsdl </webservice_path>
        <!-- this could be http or https-->
        <webservice_protocol> https </webservice_protocol>
        <!-- if true, use urlcopy script,
         otherwise use java native copiers-->
        <use_urlcopy_script> true </use_urlcopy_script>
        <!-- path to the urlcopy script -->
        <urlcopy> /opt/d-cache/srm/sbin/ </urlcopy>
        <!--nonnegative integer, 2048 by default-->
        <buffer_size> 2048 </buffer_size>
        <!--integer, 0 by default (which means do not set tcp_buffer_size at all)-->
        <tcp_buffer_size> 0 </tcp_buffer_size>
        <!--integer, 10 by default-->
        <streams_num> 10 </streams_num>
        <!-- comma separated list of protocol names, "http,gridftp" by default-->
        <protocols> http,gsiftp </protocols>
        <!-- true for pushmode and false for pullmode, false by default-->
        <pushmode> false </pushmode>
        <!-- true to use user proxy or false to use
         certificates directly, true by default-->
        <useproxy> true </useproxy>
        <!--absolute path to user proxy-->
        <x509_user_proxy> /tmp/x509up_u501 </x509_user_proxy>
        <!--absolute path to user (or host) private key-->
        <x509_user_key> /home/gcowan/.globus/userkey.pem </x509_user_key>
        <!--absolute path to user (or host) certificate-->
        <x509_user_cert> /home/gcowan/.globus/usercert.pem </x509_user_cert>
        <!--absolute path to the trusted certificates directory-->
        <x509_user_trusted_certificates> /etc/grid-security/certificates </x509_user_trusted_certificates>
        <!--number of miliseconds to pause for before retrying after the failure-->
        <retry_timeout> 20 </retry_timeout>
        <!--max number of times to retry after failure before giving up-->
        <retry_num> 20 </retry_num>
        <!-- true or false-->
        <connect_to_wsdl> false </connect_to_wsdl>
        <!-- true or false-->
        <delegate> true </delegate>
        <!-- true or false-->
        <full_delegation> true </full_delegation>