Back to BeStMan 2 User's Guide Home
Sample SRM client commands related to BeStMan2 configuration
SRM client commands can be found in bestman2/bin directory. They are full implementations of SRM v2.2 as generic SRM v2.2 clients, developed by Lawrence Berkeley National Laboratory. They have been tested for all current SRM v2.2 implementations such as BeStMan, BeStMan2, CASTOR, dCache, DPM, SRM/iRODS-SRB and StoRM. They are continuously being tested for compatibility and interoperability.
- Assume the BeStMan instance is on srm://bestman.lbl.gov:8443/srm/v2/server.
- Assume the local file path is used as /tmp/my.test.file.
- Assume the user grid proxy exists and is valid, and the user is grid-mapped on the server side as srmuser.
SRM-COPY
1. When BeStMan2 is configured with default values, and a file is requested to put into the BeStMan2 managed storage cache:
srm-copy \
file:////tmp/my.test.file \
srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/~/my.test.file
- Note that “~” is used for user’s top directory under BeStMan2 managed storage cache.
- “~” is translated into the locally mapped account from grid mapping.
- When users do not know their grid mappings, they can use “~”.
- e.g. in grid-mapfile, “/DC=org/DC=doegrids/OU=People/CN=Arie Shoshani 245501" srmuser,
- “~” is translated into “srmuser” which makes the full SFN as /srmcache/srmuser/my.test.file.
- Both SFNs srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/~/my.test.file and srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/srmuser/my.test.file would work.
2. When BeStMan2 is configured with default values, and a file is requested to get from the BeStMan2 managed storage cache:
srm-copy \
srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/srmuser/my.test.file \
file:////tmp/my.test.file2
3. When BeStMan2 is configured with default values, and a file is requested to put into the user managed storage paths (e.g. /myproject/mydir):
srm-copy \
file:////tmp/my.test.file \
srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/myproject/mydir/my.test.file
- Note that BeStMan2 does not manage these files, but provides an access to the user controlled storage space with SRM interfaces.
SRM-LS
1. When BeStMan2 is configured with default values, and a file is requested from the BeStMan2 managed storage cache:
srm-ls srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/srmuser/my.test.file
- Note that “~” is used for user’s top directory under BeStMan2 managed storage cache.
- “~” is translated into the locally mapped account from grid mapping.
- When users do not know their grid mappings, they can use “~”.
- e.g. in grid-mapfile, “/DC=org/DC=doegrids/OU=People/CN=Arie Shoshani 245501" srmuser,
- “~” is translated into “srmuser” which makes the full SFN as /srmcache/srmuser/my.test.file.
- Both SFNs srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/~/my.test.file and srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/srmuser/my.test.file would work.
2. When BeStMan2 is configured with default values, and a file is requested from the user managed storage paths (e.g. /myproject/mydir):
srm-ls srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/myproject/mydir/my.test.file
- Note that BeStman2 does not manage these files, but provides an access to the user controlled storage space with SRM interfaces.
- For permission issues, accessFileSysViaSudo or accessFileSysViaGsiftp may need to be defined.
SRM-RM
1. When BeStMan2 is configured with default values, and a file is requested to be removed from the BeStMan2 managed storage cache:
srm-rm srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/srmuser/my.test.file
2. When BeStMan2 is configured with default values, and a file is requested to be removed from the user managed storage paths (e.g. /myproject/mydir):
srm-rm srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/myproject/mydir/my.test.file
- Note that BeStman2 does not manage these files, but provides an access to the user controlled storage space with SRM interfaces.
- For permission issues, accessFileSysViaSudo or accessFileSysViaGsiftp needs to be defined.
- When accessFileSysViaGsiftp is defined, only LBNL or FNAL implementation of srm-rm or srmrm can be used because of the delegation issue.
- LCG-utils do not delegate credentials and BeStMan2 cannot access gsiftp server to remove the requested files on behalf of the user.
- When accessFileSysViaSudo is defined, any clients implementing srmRm can be used, and /etc/sudoers needs proper entry for BeStMan2 server.
SRM-MKDIR and SRM-RMDIR
1. When BeStMan2 is configured with default values, and a directory is requested to be created or removed from the BeStMan2 managed storage cache:
srm-mkdir (or srm-rmdir) srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/srmuser/my.test.dir
2. When BeStMan2 is configured with default values, and a directory is requested to be created or removed from the user managed storage paths (e.g. /myproject/mydir):
srm-mkdir (or srm-rmdir) srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/myproject/mydir/my.test.dir
- Note that BeStman2 does not manage these files, but provides an access to the user controlled storage space with SRM interfaces.
- For permission issues, accessFileSysViaSudo or accessFileSysViaGsiftp needs to be defined.
- When accessFileSysViaGsiftp is defined, only LBNL or FNAL client implementation can be used because of the delegation issue.
- LCG-utils do not delegate credentials and BeStMan2 cannot access gsiftp server to create or remove the requested files on behalf of the user.
- When accessFileSysViaSudo is defined, any clients implementing srmRm can be used, and /etc/sudoers needs proper entry for BeStMan server.
SRMPING from FNAL client
1. When BeStMan2 is configured with default values, and FNAL SRM client srmping needs some extra flags:
srmping -2 -webservice_path=srm/v2/server -debug srm://bestman.lbl.gov:8443
Or
srmping -2 -debug srm://bestman.lbl.gov:8443/srm/v2/server
- Note that all FNAL SRM clients have default SRM service handle as srm/managerv2, and it needs to be specified in the option with “-webservice_path” for older versions.
- Also, some of FNAL SRM clients support both SRM v1.1 and SRM v2.2 with default pointing to v1.1, and it needs to be specified in the option with “-2”.
- Note that some of FNAL SRM clients have a default GSS type to support in a request call. By default it is fixed to “host”. Many of SRM deployment use other service type certificates such as “http” or “srm”. In such cases, FNAL SRM clients need ‘-gss_expected_name=srm” or “-gss_expected_name=http” as an option.
SRMLS from FNAL client
1. When BeStMan2 is configured with default values, and FNAL SRM client srmls needs some extra flags:
srmls -webservice_path=srm/v2/server srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/srmuser/my.test.file
- Note that all FNAL SRM clients have default SRM service handle as srm/managerv2, and it needs to be specified in the option with “-webservice_path”.
- Note that some of FNAL SRM clients have a default GSS type to support in a request call. By default it is fixed to “host”. Many of SRM deployment use other service type certificates such as “http” or “srm”. In such cases, FNAL SRM clients need ‘-gss_expected_name=srm” or “-gss_expected_name=http” as an option.
SRMCP from FNAL client
1. When BeStMan2 is configured with default values, and FNAL SRM client srmcp needs some extra flags:
srmcp -2 -webservice_path=srm/v2/server \
srm://bestman.lbl.gov:8443 /srm/v2/server\?SFN=/srmcache/srmuser/my.test.file \
file:////tmp/my.test.file
Or,
srmcp -2 srm://bestman.lbl.gov:8443 /srm/v2/server\?SFN=/srmcache/srmuser/my.test.file \
file:////tmp/my.test.file
- Note that all FNAL SRM clients have default SRM service handle as srm/managerv2, and it needs to be specified in the option with “-webservice_path” for older versions. Also, some of FNAL SRM clients support both SRM v1.1 and SRM v2.2 with default pointing to v1.1, and it needs to be specified in the option with “-2”.
- Extra command line options such as “-access_latency=ONLINE -retention_policy=CUSTODIAL” can be provided when supported in BeStMan2 configuration.
- Note that some of FNAL SRM clients have a default GSS type to support in a request call. By default it is fixed to “host”. Many of SRM deployment use other service type certificates such as “http” or “srm”. In such cases, FNAL SRM clients need ‘-gss_expected_name=srm” or “-gss_expected_name=http” as an option.
SRMRM from FNAL client
1. When BeStMan2 is configured with default values, and FNAL SRM client srmrm needs some extra flags:
srmrm -2 -webservice_path=srm/v2/server srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/srmuser/my.test.file
- Note that all FNAL SRM clients have default SRM service handle as srm/managerv2, and it needs to be specified in the option with “-webservice_path”. Also, some of FNAL SRM clients support both SRM v1.1 and SRM v2.2 with default pointing to v1.1, and it needs to be specified in the option with “-2”.
- Note that some of FNAL SRM clients have a default GSS type to support in a request call. By default it is fixed to “host”. Many of SRM deployment use other service type certificates such as “http” or “srm”. In such cases, FNAL SRM clients need ‘-gss_expected_name=srm” or “-gss_expected_name=http” as an option.
SRMMKDIR and SRMRMDIR from FNAL client
1. When BeStMan2 is configured with default values, and FNAL SRM client srmmkdir needs some extra flags:
srmmkdir (or srmrmdir) -webservice_path=srm/v2/server \
srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/srmuser/my.test.dir
- Note that all FNAL SRM clients have default SRM service handle as srm/managerv2, and it needs to be specified in the option with “-webservice_path”.
- Note that some of FNAL SRM clients have a default GSS type to support in a request call. By default it is fixed to “host”. Many of SRM deployment use other service type certificates such as “http” or “srm”. In such cases, FNAL SRM clients need ‘-gss_expected_name=srm” or “-gss_expected_name=http” as an option.
LCG-CP from GLITE LCG-UTILS client
1. lcg-cp only works with SRM servers running with host certficate. If BeStMan2 server runs with http or srm service certificate, lcg-cp would not work and give an error.
2. When BeStMan2 is configured with default values, and a file is requested to put into the user managed storage paths (e.g. /myproject/atlas/mydir). GLITE SRM client lcg-cp needs some extra flags:
lcg-cp -v -b -U srmv2 --vo atlas \
file:////tmp/my.test.file \
srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/myproject/atlas/mydir/my.test.file
- Note that the user file is put into the non-BeStMan2 managed storage space.
- Note that lcg-cp only works with “host” type of GSS certificates.
2. When BeStMan2 is configured with userSpaceKeywords, and a file is requested to put into the user managed storage paths (e.g. /myproject/atlas/mydir). GLITE SRM client lcg-cp needs some extra flags:
- In bestman2.rc, userSpaceKeywords=(ATLASUSERSPACE1=/myproject/atlas)
lcg-cp -v -b -U srmv2 --vo atlas -S ATLASUSERSPACE1 \
file:////tmp/my.test.file \
srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/mydir/my.test.file
- Note that the user file is put into the non-BeStMan2 managed storage space, and the space has a space token named “ATLASUSERSPACE1”. The pre-defined space token is provided with “-S” option. Upon successful request, the user file resides in /myproject/atlas/mydir/my.test.file.
- With srm-copy, the following command has the same effect, and the user file will be found in /project/atlas/mydir/my.test.file upon successful request:
srm-copy \
file:////tmp/my.test.file \
srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/mydir/my.test.file \
-spacetoken ATLASUSERSPACE1
LCG-LS from GLITE LCG-UTILS client
1. lcg-ls only works with SRM servers running with host certficate. If BeStMan2 server runs with http or srm service certificate, lcg-ls would not work and give an error.
2. Examples:
lcg-ls -b -D srmv2 -l \
srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/myproject/atlas/mydir/my.test.file
- Note that lcg-ls only works with “host” type of GSS certificates.