kcp

Back to the DH page

Description

kcp is a command line tool used to copy KLOE files to user disk areas. The selection of files is based on a SQL query.

Syntax

kcp [options] type query outdir

where:

options:

Description

kcp can be used to copy files to a user disk area. Once there, the files are not anymore under control of the data handling system; the user can manipulate them as he wants.

Normally kcp will recall files from tape if needed. Using the -d flag, only files that are already on a disk will be copied.

Without options, if a file already exist in the target directory, kcp will ask the user how to proceed; use -f (overwrite) or -n (skip), together with the -b flag if you want to use it in a script. If you instead want to copy only a subset of the selected files, use the -i flag to pick out the needed ones.

Some examples

Copy a single file into the current dir.

kcp datarec "filename='bgg027093N_ALL_f06_1_1_1_16.000'" .
Found 1 files:

bgg027093N_ALL_f06_1_1_1_16.000

Copy a set of files, some of which already exist on disk.

kcp datarec "stream_code='bgg' and run_nr=27093" .
Found 9 files:

Overwrite file bgg027093N_ALL_f06_1_1_1_16.000?[y,n]y
bgg027093N_ALL_f06_1_1_1_16.000
bgg027093N_ALL_f05_1_1_1_16.000
bgg027093N_ALL_f05_1_1_1_16.001
bgg027093N_ALL_f05_1_1_1_16.002
bgg027093N_ALL_f06_1_1_1_16.001
bgg027093N_ALL_f06_1_1_1_16.002
bgg027093N_ALL_f07_1_1_1_16.000
bgg027093N_ALL_f07_1_1_1_16.001
bgg027093N_ALL_f07_1_1_1_16.002

A more elaborate request to copy raw files to a subdir, limiting to the files already on disk.

kcp -d raw "stream_code='ALL' and torta_name='2sect_DC2_c5' and Zero_Sup=1 and run_nr between 26000 and 26335" raws/
Found 28 files:

raw026010N_ALL_f06_1_1_1.004
raw026010N_ALL_f06_1_1_1.005
raw026010N_ALL_f06_1_1_1.006
...

A simple Monte Carlo request, using batch mode with forced overwrite.

kcp -b -f mc "mccard_code='kskl_2pi'" /scratch/myMCs/

Same request, but peeking out only a few files.

kcp -i mc "mccard_code='kskl_2pi'" /scratch/myMCs/
Found 10 files:

Create file rmc000001_kskl_2pi_14.mcr?[y,n]n
Create file rmc000002_kskl_2pi_14.mcr?[y,n]y
Create file rmc000003_kskl_2pi_14.mcr?[y,n]n
Create file rmc000004_kskl_2pi_14.mcr?[y,n]n
Create file rmc000005_kskl_2pi_14.mcr?[y,n]n
Create file rmc000006_kskl_2pi_14.mcr?[y,n]n
Overwrite file rmc000007_kskl_2pi_14.mcr?[y,n]y
Create file rmc000008_kskl_2pi_14.mcr?[y,n]n
Create file rmc000009_kskl_2pi_14.mcr?[y,n]n
Create file rmc000010_kskl_2pi_14.mcr?[y,n]n
rmc000002_kskl_2pi_14.mcr
rmc000007_kskl_2pi_14.mcr

FAQ (Frequently Asked Questions)

None yet.

Please send questions to Igor Sfiligoi


Send comment to Igor Sfiligoi.