Project

General

Profile

How to Access Files in SAM » History » Version 7

Version 6 (Qizhong Li, 12/04/2014 08:50 AM) → Version 7/8 (Qizhong Li, 12/04/2014 09:26 AM)

h1. How to Access Files in SAM

h2. To setup SAM:
<pre>
> kinit
> kx509
> setup sam_web_client
</pre>

h2. To setup IFDH commands:
<pre>
> setup ifdhc v1_6_2
</pre>

h2. To fetch one file from SAM using the file name:
<pre>
> ifdh_fetch -e lbne filename
</pre>

For example:
<pre>

<lbnegpvm02.fnal.gov> ifdh_fetch -e lbne v35t_r0000101_s0001_test_raw.root
found file on enstore, using dcache gridftp
doing: ifdh cp gsiftp://fndca1.fnal.gov:2811/test-data/lbne/raw/00/00/69/00/v35t_r0000101_s0001_test_raw.root ./v35t_r0000101_s0001_test_raw.root

<lbnegpvm02.fnal.gov> ls *.root
v35t_r0000101_s0001_test_raw.root
<lbnegpvm02.fnal.gov>
</pre>

h2. To get all files from a dataset definition:
(you can use my script /lbne/app/users/qzli/dhtools/get_files.py)

<pre>
> /lbne/app/users/qzli/dhtools/get_files.py definition-name destination-location
</pre>
I strongly suggest you first check how many files are in this dataset definition to
make sure you have enough disk space in your destination area before you get these files.


For example:
<pre>
<lbnegpvm02.fnal.gov> /lbne/app/users/qzli/dhtools/get_files.py singleparticle-test /scratch/lbne/qzli/files/
Project name is qzli_singleparticle-test_20141203120539
Project URL is http://samweb.fnal.gov:8480/sam/lbne/api/running/projects/lbne/qzli_singleparticle-test_20141203120539
...
<lbnegpvm02.fnal.gov> ls /scratch/lbne/qzli/files/
35T_singleparticle_piplus_01.root 35T_singleparticle_proton_01.root
<lbnegpvm02.fnal.gov>
</pre>