release notes | Book: 1.9.5, 1.9.12 (opt, FHS), 2.7 (FHS), 2.8 (FHS), 2.9 (FHS), 2.10 (FHS), 2.11 (FHS), 2.12 (FHS), 2.13 (FHS), | Wiki | Q&A black_bg
Web: Multi-page, Single page | PDF: A4-size, Letter-size | eBook: epub black_bg

SRM

dCache provides a series of clients one of which is the SRM client which supports a large number operations, but is just one Java application, the script name is sent to the Java applications command line to invoke each operation.

This page just shows the scripts command line and not the invocation of the Java application directly.

[return to top]

Creating a new directory.

Usage:

srmmkdir [[command line options]] [<srmUrl>]

Example:

Example:

The following example creates the directory /pnfs/example.org/data/dteam/myDir.

[user] $ srmmkdir srm://srm-door.example.org:8443/pnfs/example.org/data/dteam/myDir

[return to top]

Removing files from dCache

Usage:

srmrm [[command line options]] [<srmUrl> ...]

Example:

[user] $ srmrm srm://srm-door.example.org:8443/pnfs/example.org/data/dteam/myDir/myFile

[return to top]

Removing empty directories from dCache

It is allowed to remove only empty directories as well as trees of empty directories.

Usage:

srmrmdir [command line options] [<srmUrl>]

Examples:

Example:

[user] $ srmrmdir srm://srm-door.example.org:8443/pnfs/example.org/data/dteam/myDir

Example:

[user] $ srmrmdir -recursive=true srm://srm-door.example.org:8443/pnfs/example.org/data/dteam/myDir

[return to top]

srmcp for SRM v1

Usage:

srmcp [command line options] <source>... [<destination>]

or

srmcp [command line options] [-copyjobfile] <file>

[return to top]

Copying files to dCache

Example:

[user] $ srmcp -webservice_protocol=http \
   file://///etc/group \
   srm://srm-door.example.org:8443/pnfs/example.org/data/dteam/test_Srm.clinton.501.32050.20070907153055.0

[return to top]

Copying files from dCache

[user] $ srmcp -webservice_protocol=http \
   srm://srm-door.example.org:8443/pnfs/example.org/data/dteam/test_Srm.clinton.501.32050.20070907153055.0 \
   file://///tmp/testfile1 -streams_num=1

[return to top]

srmcp for SRM v2.2

[return to top]

Getting the dCache Version

The srmping command will tell you the version of dCache. This only works for authorized users and not just authenticated users.

[user] $ srmping -2 srm://srm-door.example.org:8443/pnfs
WARNING: SRM_PATH is defined, which might cause a wrong version of srm client to be executed
WARNING: SRM_PATH=/opt/d-cache/srm
VersionInfo : v2.2
backend_type:dCache
backend_version:production-1-9-1-11

[return to top]

Space Tokens

Space token support must be set up and reserving space with the admin interface this is also documented in the SRM section and in the dCache wiki.

[return to top]

Space Token Listing

Usage:

get-space-tokens [command line options] [<srmUrl>]

Example 21.1. surveying the space tokens available in a directory.

[user] $ srm-get-space-tokens srm://srm-door.example.org:8443/pnfs/example.org/data/dteam -srm_protocol_version=2

A successful result:

return status code : SRM_SUCCESS
return status expl. : OK
Space Reservation Tokens:
148241
148311
148317
28839
148253
148227
148229
148289
148231
148352

Example 21.2. Listing the space tokens for a SRM:

[user] $ srm-get-space-tokens srm://srm-door.example.org:8443
Space Reservation Tokens:
145614
145615
144248
144249
25099
145585
145607
28839
145589

[return to top]

Space Reservation

Usage:

srm-reserve-space [[command line options]] [<srmUrl>]

[user] $ srm-reserve-space  \
-desired_size 2000 \
-srm_protocol_version=2 \
-retention_policy=REPLICA \
-access_latency=ONLINE \
-guaranteed_size 1024 \
-lifetime 36000 \
srm://srm-door.example.org:8443/pnfs/example.org/data/dteam

A successful result:

Space token =144573

A typical failure

SRMClientV2 : srmStatusOfReserveSpaceRequest , contacting service httpg://srm-door.example.org:8443/srm/managerv2
status: code=SRM_NO_FREE_SPACE explanantion= at Thu Nov 08 15:29:44 CET 2007 state Failed :  no space available
lifetime = null
access latency = ONLINE
retention policy = REPLICA
guaranteed size = null
total size = 34

Also you can get info for this space token 144573:

[user] $ srm-get-space-metadata srm://srm-door.example.org:8443/pnfs/example.org/data/dteam -space_tokens=144573

Possible result:

Space Reservation with token=120047
                   owner:VoGroup=/dteam VoRole=NULL
               totalSize:1024
          guaranteedSize:1024
              unusedSize:1024
        lifetimeAssigned:36000
            lifetimeLeft:25071
           accessLatency:ONLINE
         retentionPolicy:REPLICA

[return to top]

Writing to a Space Token

Usage: srmcp [command line options] source(s) destination

Examples:

[user] $ srmcp -protocols=gsiftp -space_token=144573 \
file://///home/user/path/to/myFile \
srm://srm-door.example.org:8443/pnfs/example.org/data/dteam/myFile
[user] $ srmcp -protocols=gsiftp -space_token=144573 \
file://///home/user/path/to/myFile1 \
file://///home/user/path/to/myFile2 \
srm://srm-door.example.org:8443/pnfs/example.org/data/dteam

[return to top]

Space Metadata

Users can get the metadata available for the space, but the ability to query the metadata of a space reservation may be restricted so that only certain users can obtain this information.

[user] $ srm-get-space-metadata srm://srm-door.example.org:8443/pnfs/example.org/data/dteam -space_tokens=120049
WARNING: SRM_PATH is defined, which might cause a wrong version of srm client to be executed
WARNING: SRM_PATH=/opt/d-cache/srm
Space Reservation with token=120049
                   owner:VoGroup=/dteam VoRole=NULL
               totalSize:1024
          guaranteedSize:1024
              unusedSize:1024
        lifetimeAssigned:36000
            lifetimeLeft:30204
           accessLatency:ONLINE
         retentionPolicy:REPLICA

[return to top]

Space Token Release

Removes a space token from the SRM.

[user] $ srm-release-space srm://srm-door.example.org:8443 -space_token=15

[return to top]

Listing a file in SRM

SRM version 2.2 has a much richer set of file listing commands.

Usage:

srmls [command line options] <srmUrl>...

Example 21.3. Using srmls -l:

[user] $ srmls srm://srm-door.example.org:8443/pnfs/example.org/data/dteam/testdir  -2
  0 /pnfs/example.org/data/dteam/testdir/
      31 /pnfs/example.org/data/dteam/testdir/testFile1
      31 /pnfs/example.org/data/dteam/testdir/testFile2
      31 /pnfs/example.org/data/dteam/testdir/testFile3
      31 /pnfs/example.org/data/dteam/testdir/testFile4
      31 /pnfs/example.org/data/dteam/testdir/testFile5

Note

The -l option results in srmls providing additional information. Collecting this additional information may result in a dramatic increase in execution time.

Example 21.4. Using srmls -l:

[user] $ srmls -l srm://srm-door.example.org:8443/pnfs/example.org/data/dteam/testdir -2
  0 /pnfs/example.org/data/dteam/testdir/
  storage type:PERMANENT
  retention policy:CUSTODIAL
  access latency:NEARLINE
  locality:NEARLINE
 locality: null
   UserPermission: uid=18118 PermissionsRWX
   GroupPermission: gid=2688 PermissionsRWX
  WorldPermission: RX
 created at:2007/10/31 16:16:32
 modified at:2007/11/08 18:03:39
   - Assigned lifetime (in seconds):  -1
  - Lifetime left (in seconds):  -1
  - Original SURL:  /pnfs/example.org/data/dteam/testdir
 - Status:  null
 - Type:  DIRECTORY
      31 /pnfs/example.org/data/dteam/testdir/testFile1
      storage type:PERMANENT
      retention policy:CUSTODIAL
      access latency:NEARLINE
      locality:NEARLINE
      - Checksum value:  84d007af
      - Checksum type:  adler32
       UserPermission: uid=18118 PermissionsRW
       GroupPermission: gid=2688 PermissionsR
      WorldPermission: R
     created at:2007/11/08 15:47:13
     modified at:2007/11/08 15:47:13
       - Assigned lifetime (in seconds):  -1
      - Lifetime left (in seconds):  -1
      - Original SURL:  /pnfs/example.org/data/dteam/testdir/testFile1
 - Status:  null
 - Type:  FILE

If you have more than 1000 entries in your directory then dCache will return only the first 1000. To view directories with more than 1000 entries, please use the following parameters:

srmls parameters

-count=<integer>

The number of entries to report.

-offset=<integer>

Example 21.5. Limited directory listing

The first command shows the output without specifying -count or -offset. Since the directory contains less than 1000 entries, all entries are listed.

[user] $ srmls srm://srm-door.example.org:8443/pnfs/example.org/data/dteam/dir1 \
srm://srm-door.example.org:8443/pnfs/example.org/data/dteam/dir2
  0 /pnfs/example.org/data/dteam/dir1/
      31 /pnfs/example.org/data/dteam/dir1/myFile1
      28 /pnfs/example.org/data/dteam/dir1/myFile2
      47 /pnfs/example.org/data/dteam/dir1/myFile3
  0 /pnfs/example.org/data/dteam/dir2/
      25 /pnfs/example.org/data/dteam/dir2/fileA
      59 /pnfs/example.org/data/dteam/dir2/fileB

The following examples shows the result when using the -count option to listing the first three entries.

[user] $ srmls -count=3 srm://srm-door.example.org:8443/pnfs/example.org/data/dteam/testdir  -srm_protocol_version=2
0 /pnfs/example.org/data/dteam/testdir/
      31 /pnfs/example.org/data/dteam/testdir/testFile1
      31 /pnfs/example.org/data/dteam/testdir/testFile2
      31 /pnfs/example.org/data/dteam/testdir/testFile3

In the next command, the -offset option is used to view a different set of entries.

[user] $ srmls -count=3 -offset=1 srm://srm-door.example.org:8443/pnfs/example.org/data/dteam/testdir  -srm_protocol_version=2
0 /pnfs/example.org/data/dteam/testdir/
      31 /pnfs/example.org/data/dteam/testdir/testFile2
      31 /pnfs/example.org/data/dteam/testdir/testFile3
      31 /pnfs/example.org/data/dteam/testdir/testFile4