next up previous contents
Next: Retrieving Files Up: Managing Data with edg-rm Previous: Listing Directory and Files   Contents

Writing and Registering Files

Users are enabled to store and register files in the Replica Catalogue using the edg-rm command copyAndRegisterFile as shown in the simple script below.


copyAndRegisterFile with Destination ONLY
$ cat master-cp.sh
#!/bin/bash
#
# create master copy of Master-test.rm
#
edg-rm -v --vo=alice copyAndRegisterFile \
file:$HOME/Jones/Reptest/JJ-test.rm \
-l lfn:JJ-test-cern.rm \
-d adc0021.cern.ch


The tool options are:
-v to produce verbose log
--vo=alice to specify the virtual organization

The cr command (abbreviated form for copyAndRegisterFile) options are:
file: to specify the local file name
-l lfn: to specify the LFN name if different from the local file name
-d SE-DNS to specify the destination SE as default node name

The verbose log reports user supplied options, file size, copy protocol, Replica Manager generated file name, guid and operation status, as shown in the example below:

edg-replica-manager starting..
Issuing command : copyAndRegisterFile
Parameters:
file:/home/Jones/RepTest/JJ-test.rm
-l
lfn:JJ-test-cern.rm
-d
adc0021.cern.ch
Destination is a host : //adc0021.cern.ch
Call replica manager copyAndRegister function
Filesize to copy (MB) = 1.2874603E-4
copy : From     : /home/Jones/RepTest/JJ-test.rm
copy : To       : gsiftp://adc0021.cern.ch/flatfiles/SE00/alice/
                  generated/2003/11/25/file4259968c-1f58-11d8-ab78-d38fa2b63747
copy : Protocol : gsiftp
copy : # streams: 1
Transfer took: 1148 ms.
Copy successful to : File name       = gsiftp://adc0021.cern.ch/
                                       flatfiles/SE00/alice/generated/
                        2003/11/25/file4259968c-1f58-11d8-ab78-d38fa2b63747
File size       = 135
File Owner      = -
Associated SE:
Created new entry for file with logical name lfn:JJ-test-cern.rm
guid:56c3e03d-1f58-11d8-ab78-d38fa2b63747
Copy and Registration successful.
The verbose log notifies the user the following relevant informations:


Default File Naming Example
Name Item Item Value
SE node name adc0021.cern.ch
SE root directory /flatfiles/SE00/alice/
SE default subdir generated/2003/11/25/
SE file name file4259968c-1f58-11d8-ab78-d38fa2b63747
User defined lfn JJ-test-cern.rm
File guid 56c3e03d-1f58-11d8-ab78-d38fa2b63747


As we have shown in the above example, the file name is choosen by the Replica Manager when the user supplies only the SE DNS. If the user wants to store a meaningful file name, the destination must define a complete path with a SURL as shown in the next example.


copyAndRegisterFile with Directiry Tree
edg-rm -v --vo=alice copyAndRegisterFile \
file:$HOME/RepTest/Master-test.rm \
-l lfn:JJ-Master-test.rm \
-d srm://adc0021.cern.ch/flatfiles/SE00/alice/JJ01File


In this example, the cr command (abbreviated form for copyAndRegisterFile) specifies the destination as a SURL according to the following general syntax:

-d srm://node-DNS/full SE path/PFN File-name

The verbose log reports user supplied options, file size, copy protocol, user generated file name, guid and operation status, as shown in the example below:

edg-replica-manager starting..
Issuing command : copyAndRegisterFile
Parameters:
file:/home/Jones/RepTest/Master-test.rm
-l
lfn:JJ-Alice-Master-test.rm
-d
srm://adc0021.cern.ch/flatfiles/SE00/alice/JJ001Master-test.rm
Destination is an SURL : 
srm://adc0021.cern.ch/flatfiles/SE00/alice/JJ001Master-test.rm
Call replica manager copyAndRegister function
Filesize to copy (MB) = 1.2874603E-4
copy : From     : /home/Jones/RepTest/Master-test.rm
copy : To       : 
gsiftp://adc0021.cern.ch/flatfiles/SE00/alice/JJ001Master-test.rm
copy : Protocol : gsiftp
copy : # streams: 1
Transfer took: 1188 ms.
Copy successful to : File name       = 
gsiftp://adc0021.cern.ch/flatfiles/SE00/alice/JJ001Master-test.rm
File size       = 135
File Owner      = -
Associated SE:
Created new entry for file with logical name lfn:JJ-Alice-Master-test.rm
guid:aa1d1c8c-1ff6-11d8-9536-ad736146adda
Copy and Registration successful.


User Defines File Naming Example
Name Item Item Value
SE node name adc0021.cern.ch
SE root directory /flatfiles/SE00/alice/
SE default subdir none or user defined
SE file name JJ001Master-test.rm
User defined lfn JJ-Alice-Master-test.rm
File guid aa1d1c8c-1ff6-11d8-9536-ad736146adda



next up previous contents
Next: Retrieving Files Up: Managing Data with edg-rm Previous: Listing Directory and Files   Contents
luvisetto 2003-12-17