SRM-DIR
SRM-Client Tools
User�s Guide
Feb. 13, 2009
Alex Sim, Vijaya
Natarajan, Junmin Gu, Arie Shoshani
Lawrence Berkeley National Laboratory
http://datagrid.lbl.gov/bestman
[email protected]
Table of contents
4������ Configuration, configuration options, configuration file and notes
5.5.2�������� Make a directory
5.5.3�������� Remove an empty directory
5.5.5�������� Move an SURL to another SURL
BeStMan Copyright (c) 2007,2008,2009, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy).� All rights reserved.
If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Technology Transfer Department at [email protected] �and [email protected].
NOTICE.� This software was developed under partial funding from the U.S. Department of Energy.� As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly.� Beginning five (5) years after the date permission to assert copyright is obtained from the U.S. Department of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so.
For the end user license agreement file for BeStMan for non-commercial research use, go to http://datagrid.lbl.gov/bestman/license-nc.html.
For the end user license agreement file for BeStMan for commercial research use, go to http://datagrid.lbl.gov/bestman/license-c.html.
SRM client tools 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, CASTOR, dCache, DPM, SRM/iRODS-SRB and StoRM. They are continuously being tested for compatibility and interoperability.
It�s a java implementation that would run on any OS platforms, and currently supports gsiftp, http, https and ftp as its file transfer protocols.
It requires the minimal administrative efforts on the deployment and maintenance.
SRM
v2.2 specification can be found on http://sdm.lbl.gov/srm-wg/doc/SRM.v2.2.html.
SRM client downloads and instructions can be found on
http://datagrid.lbl.gov/bestman.
� SUN Java 1.5.0_12 or IBM Java 1.5 or higher versions such as 1.6.0_07.
� Valid user grid proxy
� Refer to SRM Client User�s Guide.
4 Configuration, configuration options, configuration file and notes
� Refer to SRM Client User�s Guide.
srm-dir submits directory management related requests, such as LS, MKDIR, RMDIR, RM, and MV.
� srm-dir <source_url> -ls [command line options]
� srm-dir <source_url> -mkdir [command line options]
� srm-dir <source_url> -rmdir [command line options]
� srm-dir <source_url> -rm [command line options]
� srm-dir �<source_url> <target_url> -mv [command line options]
�
srm-dir -f <input_file> [command line options]
� Command line options take priority from the options from conf file.
� Options in the following table are in alphabetical order
-authid <string> |
� Authorization� ID to be used in SRM for the request |
-conf <path> |
� Path to the configuration file. � Command line options will override the options from conf file |
-connectiontimeout <int> |
� Specifies time in seconds to wait for soap or gsi connection before timing out. � Default=1800 |
-count <int> |
� Specifies count for LS in case there are too many listing � Default=0 |
-debug |
� Specifies debugging output � Default=false |
-delegation <true|false> |
� Force proxy delegation. � When not provided, srm-dir makes no delegation by default, and automatically handles proxy delegation based on the source URLs. � When -delegation is provided, it overrides the automatic handling and forces the user choice. |
-f <path> |
� Path to the xml input file containing the source url, target url information for requests with more than one file � Refer to the format and an example in 6.3 |
-filestoragetype <p | d | v> |
� Indicates file storage type � p - Permanent, d - Durable, v - Volatile � no default |
-fulldetailed |
� Specify to request detailed information on the source url � Only works with -ls � Default=false |
-help |
� Show the help message |
-log <path> |
� Specifies path to log file � Default=./srmclient-event-date-random.log |
-ls |
� Request to browse the source url |
-mkdir |
� Request to create a directory on the source url |
-mv |
� Request to move a directory or a file from source url to target url |
-numlevels <int> |
� Specifies the number of levels of recursiveness in LS � Default=1 |
-offset <int> |
� Specifies offset for LS in case there are too many listing � Default=0 |
-proxyfile <path> |
� Path to user grid proxy |
-quiet |
� Suppress output in the console. � This option writes the output to the log file. |
-recursive |
� Specifies recursive listing with -ls option � Specifies recursive removal of an empty directory with -rmdir option. To specify a selective removal of empty directories, the list needs to be specified in the input file, not in the command line option. � Default=false |
-renewproxy |
� Enables automatic proxy renewal upon expiration � Works only when -usercert and -userkey are provided � Default=false |
-report <path> |
� Specifies path to full report output. |
-rm |
� Request to remove a file on the source url |
-rmdir |
� Request to remove the directory on the source url |
-s <source_url> |
� Source URL |
-serviceurl <ws_endpoint> |
� Full web service endpoint � Required when source url or target url does not contain web service endpoint information |
-status <request_token> |
� Specifies request token for checking the status of LS when SRM returned a request token |
-statusmaxtime <int> |
� Max time before status checks get timed out, in seconds � Default=600 |
-statuswaittime <int> |
� Wait time delay between status check, in seconds � Default=30 |
-storageinfo |
� extra storage access information � Default=false �
For BeStMan supporting MSS, a formatted input separated by
comma is used with following keywords when necessary: |
-t <target_url> |
� Target URL |
-td <target_url> |
� Target URL as directory path � Required for multiple �get� file requests if input file does not contain the target information. � When both target information in the input file and �td option are provided, command line option �td will take priority and information in the input file will be ignored. |
-usercert <path> |
� Path to user grid certificate |
-userkey <path> |
� Path to user grid certificate key |
-xmlreport <path> |
� Specifies path to short output report in XML format. |
� srm-dir makes no proxy delegation by default, and automatically handles proxy delegation based on the source urls. A user can override the automatic handling by providing an option �-delegation� (or �-delegation true�) to force the delegation, and �-delegation false� to force no delegation. �-debug� option would show how the delegation is done on the output.
<?xml version="1.0" encoding="UTF-8"?>
<request>
� <file>
��� <sourceurl>Source_URL</sourceurl>
��� <targeturl>Target_URL</targeturl>
</file>
</request>
� Example 1 : LS operation
<?xml version="1.0" encoding="UTF-8"?>
<request>
� <file>
��� <sourceurl>srm://bestman.lbl.gov:8443/srm/v2/server?SFN=/mydir/mypath/myfile</sourceurl>
� </file>
</request>
� Example 2 : MV operation
<?xml version="1.0" encoding="UTF-8"?>
<request>
� <file>
��� <sourceurl>srm://bestman.lbl.gov:8443/srm/v2/server?SFN=/mydir/my.source.file</sourceurl>
��� <targeturl>srm://bestman.lbl.gov:8443/srm/v2/server?SFN=/mydir/my.target.file</targeturl>
� </file>
</request>
1.
srm-dir� srm://host:port/wsept\?SFN=/source_filepath� -ls
This command retrieves the file info from SRM
or from the file system that SRM can access to. Click here for the sample output.
1.1. srm-dir�
srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/guest/test.data \
�������������� -ls
2. srm-dir� gsiftp://host:port//target_filepath -ls
This command retrieves the file information from the gridftp server. Click here for the sample output.
2.1. srm-dir�
gsiftp://gridftphost.lbl.gov//data/path/test.data -ls
3. srm-dir srm://host:port /wsept\?SFN=/source_dirpath -ls -recursive
This command retrieves the directory info recursively from SRM or from the file system that SRM can access to. Click here for the sample output.
3.1. srm-dir
srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/guest �\
������������ -ls� -recursive
4. srm-dir� gsiftp://host:port//source_dirpath -ls -recursive
This command retrieves the directory info recursively from the gridftp server. Click here for the sample output.
4.1. srm-dir
gsiftp://gridftphost.lbl.gov//data/path/source.dir� -ls -recursive
1. srm-dir� srm://host:port/wsept\?SFN=/source_dirpath -mkdir
This command requests to create a directory as SURL in SRMor in the file system that SRM can access to. Click here for the sample output.
1.1. srm-dir� srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/guest/test.dir
\
������������� -mkdir
5.5.3 Remove an empty directory
1. srm-dir� srm://host:port/wsept\?SFN=/source_dirpath -rmdir
This command requests to remove an empty directory in SRM or in the file system that SRM can access to. Click here for the sample output.
1.1. srm-dir� srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/guest/test.dir
\
�������������� -rmdir
1. srm-dir� srm://host:port/wsept\?SFN=/source_filepath -rm
This command requests to remove a file from SRMor from the file system that SRM can access to. Click here for the sample output.
1.1. srm-dir� srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/guest/test.file
\
�������������� -rm
5.5.5 Move an SURL to another SURL
1.
srm-dir� srm://host:port/wsept\?SFN=/source_path \
�������������� srm://host:port/wsept\?SFN=/target_path \
�������������� -mv
This command requests to move a source SURL to a target SURL in SRM or in the file system that SRM can access to. Source and target SURLs can be directories. Click here for the sample output.
1.1. srm-dir� srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/guest/source.file
\
�������������� srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/guest/target.file
\
�������������� -mv
1.2. srm-dir� srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/guest/source.dir
\
�������������� srm://bestman.lbl.gov:8443/srm/v2/server\?SFN=/srmcache/guest/target.dir
\
�������������� -mv
When SRM client commands exit, they have exit codes as following:
0 |
SRM_SUCCESS |
51 |
SRM_FAILURE |
52 |
SRM_AUTHENTICATION_FAILURE |
53 |
SRM_AUTHORIZATION_FAILURE |
54 |
SRM_INVALID_REQUEST |
55 |
SRM_INVALID_PATH |
56 |
SRM_FILE_LIFETIME_EXPIRED |
57 |
SRM_SPACE_LIFETIME_EXPIRED |
58 |
SRM_EXCEED_ALLOCATION |
59 |
SRM_NO_USER_SPACE |
60 |
SRM_NO_FREE_SPACE |
61 |
SRM_DUPLICATION_ERROR |
62 |
SRM_NON_EMPTY_DIRECTORY |
63 |
SRM_TOO_MANY_RESULTS |
64 |
SRM_INTERNAL_ERROR |
65 |
SRM_FATAL_INTERNAL_ERROR |
66 |
SRM_NOT_SUPPORTED |
67 |
SRM_REQUEST_QUEUED |
68 |
SRM_REQUEST_INPROGRESS |
69 |
SRM_REQUEST_SUSPENDED |
70 |
SRM_ABORTED |
71 |
SRM_RELEASED |
72 |
SRM_FILE_PINNED |
73 |
SRM_FILE_IN_CACHE |
74 |
SRM_SPACE_AVAILABLE |
75 |
SRM_LOWER_SPACE_GRANTED |
76 |
SRM_DONE |
77 |
SRM_PARTIAL_SUCCESS |
78 |
SRM_REQUEST_TIMED_OUT |
79 |
SRM_LAST_COPY |
80 |
SRM_FILE_BUSY |
81 |
SRM_FILE_LOST |
82 |
SRM_FILE_UNAVAILABLE |
83 |
SRM_UNKNOWN_ERROR |
90 |
Connection refused |
91 |
GSI mapping not found |
92 |
General unpredictable exception |
93 |
Input error |
94 |
Other error, not reached SRM yet |
100 |
SRM returned no status, but it is a failure |
� When a large LS request is submitted or expected, the srm-dir may not fill all request or status information into the memory. It is mostlikely because the memory size of the java virtual machine.� In such case, you can increase the size of the virtual machine in srm-dir by -Xmx###M, where # is the amount of memory which you want to allocate in megabytes. E.g. java �Xmx512M
� For memory conscious jobs, �-lite� option is provided to use less memory to handle the user request. The option the passes -Xms32M to the virtual machine.
srm-ls, srm-rm, srm-mkdir, srm-rmdir, srm-mv