kls |
kls is a command line tool used to list the available files and their position. The selection of files is based on a SQL query.
kls [options] type query
where:
type - one of:
raw
datarec
mc
query - where part of an SQL query based on logger.type_data (raw_data, datarec_data or mc_data)
options:
-b - brief format, show only the best one
-d - disk only, show only files that are on disk
The output of kls is a set of lines, where each line contains a filename and a list of locations where the file resides. Files can be located:
only on tape, in which case the on tape label is printed
on one or more disk locations; in this case all the disk locations will be printed, with the following syntax
online - the file is located on the DAQ disk pool (/data/farm)
offline - the file is located on the offline (/datarec)
recalled (followed by a list recall areas) - the file is available on the listed recall areas
nor on disk nor on tape, so the lost label is printed
Using the -b flag, a script friendly output is produced. The first line contains a human readable count of lines, while the others have each:
the fastest accessible location for the file
if it is tape, a recall is needed
else the type of disk, server_id and dir_id are printed
the file name
Using the -d flag, only files that are already on a disk are shown.
A list of datarec files:
kls datarec "stream_code='bgg' and version=16 and run_nr=22653" Found 24 files: bgg022653N_ALL_f05_1_1_1_16.000 0.2Mb offline recalled: {f0a 14} bgg022653N_ALL_f05_1_1_1_16.001 0.2Mb offline recalled: {f0a 14} bgg022653N_ALL_f05_1_1_1_16.002 0.2Mb offline recalled: {f0a 14}, {f0b 14} bgg022653N_ALL_f05_1_1_1_16.003 0.1Mb on tape bgg022653N_ALL_f05_1_1_1_16.004 0.1Mb offline bgg022653N_ALL_f05_1_1_1_16.005 0.2Mb on tape bgg022653N_ALL_f05_1_1_1_16.006 0.2Mb on tape bgg022653N_ALL_f05_1_1_1_16.007 0.2Mb offline bgg022653N_ALL_f06_1_1_1_16.000 0.2Mb on tape bgg022653N_ALL_f06_1_1_1_16.001 0.2Mb offline bgg022653N_ALL_f06_1_1_1_16.002 0.2Mb offline recalled: {f0a 15} bgg022653N_ALL_f06_1_1_1_16.003 0.1Mb offline bgg022653N_ALL_f06_1_1_1_16.004 0.1Mb offline recalled: {f0a 14}, {f0a 15} bgg022653N_ALL_f06_1_1_1_16.005 0.1Mb offline bgg022653N_ALL_f06_1_1_1_16.006 0.2Mb on tape bgg022653N_ALL_f06_1_1_1_16.007 0.2Mb on tape bgg022653N_ALL_f07_1_1_1_16.000 0.2Mb offline bgg022653N_ALL_f07_1_1_1_16.001 0.2Mb offline bgg022653N_ALL_f07_1_1_1_16.002 0.2Mb on tape bgg022653N_ALL_f07_1_1_1_16.003 0.1Mb offline bgg022653N_ALL_f07_1_1_1_16.004 0.1Mb offline bgg022653N_ALL_f07_1_1_1_16.005 0.1Mb on tape bgg022653N_ALL_f07_1_1_1_16.006 0.2Mb on tape bgg022653N_ALL_f07_1_1_1_16.007 0.2Mb on tape
Limiting the output only to files on disk:
kls -d datarec "stream_code='bgg' and version=16 and run_nr=22653" Found 14 files: bgg022653N_ALL_f05_1_1_1_16.000 0.2Mb offline recalled: {f0a 14} bgg022653N_ALL_f05_1_1_1_16.001 0.2Mb offline recalled: {f0a 14} bgg022653N_ALL_f05_1_1_1_16.002 0.2Mb offline recalled: {f0a 14}, {f0b 14} bgg022653N_ALL_f05_1_1_1_16.004 0.1Mb offline bgg022653N_ALL_f05_1_1_1_16.007 0.2Mb offline bgg022653N_ALL_f06_1_1_1_16.001 0.2Mb offline bgg022653N_ALL_f06_1_1_1_16.002 0.2Mb offline recalled: {f0a 15} bgg022653N_ALL_f06_1_1_1_16.003 0.1Mb offline bgg022653N_ALL_f06_1_1_1_16.004 0.1Mb offline recalled: {f0a 14}, {f0a 15} bgg022653N_ALL_f06_1_1_1_16.005 0.1Mb offline bgg022653N_ALL_f07_1_1_1_16.000 0.2Mb offline bgg022653N_ALL_f07_1_1_1_16.001 0.2Mb offline bgg022653N_ALL_f07_1_1_1_16.003 0.1Mb offline bgg022653N_ALL_f07_1_1_1_16.004 0.1Mb offline
Brief format:
kls -b datarec "stream_code='bgg' and version=16 and run_nr=22653" Found 24 files: recalled f0a 14 bgg022653N_ALL_f05_1_1_1_16.000 recalled f0a 14 bgg022653N_ALL_f05_1_1_1_16.001 recalled f0a 14 bgg022653N_ALL_f05_1_1_1_16.002 tape bgg022653N_ALL_f05_1_1_1_16.003 offline f29 1 bgg022653N_ALL_f05_1_1_1_16.004 tape bgg022653N_ALL_f05_1_1_1_16.005 tape bgg022653N_ALL_f05_1_1_1_16.006 offline f29 1 bgg022653N_ALL_f05_1_1_1_16.007 tape bgg022653N_ALL_f06_1_1_1_16.000 offline f29 1 bgg022653N_ALL_f06_1_1_1_16.001 recalled f0a 15 bgg022653N_ALL_f06_1_1_1_16.002 offline f29 1 bgg022653N_ALL_f06_1_1_1_16.003 recalled f0a 14 bgg022653N_ALL_f06_1_1_1_16.004 offline f29 1 bgg022653N_ALL_f06_1_1_1_16.005 tape bgg022653N_ALL_f06_1_1_1_16.006 tape bgg022653N_ALL_f06_1_1_1_16.007 offline f29 1 bgg022653N_ALL_f07_1_1_1_16.000 offline f29 1 bgg022653N_ALL_f07_1_1_1_16.001 tape bgg022653N_ALL_f07_1_1_1_16.002 offline f29 1 bgg022653N_ALL_f07_1_1_1_16.003 offline f29 1 bgg022653N_ALL_f07_1_1_1_16.004 tape bgg022653N_ALL_f07_1_1_1_16.005 tape bgg022653N_ALL_f07_1_1_1_16.006 tape bgg022653N_ALL_f07_1_1_1_16.007
Which raw files of a certain period are on disk?
kls -d raw "stream_code='ALL' and run_nr between 19000 and 19200" Found 14 files: raw019189N_ALL_f05_1_1_1.000 1073.7Mb recalled: {f0b 13} raw019189N_ALL_f05_1_1_1.001 1073.7Mb recalled: {f0b 13} raw019189N_ALL_f05_1_1_1.002 1073.7Mb recalled: {f0b 13} raw019189N_ALL_f05_1_1_1.003 1068.9Mb recalled: {f0b 13} raw019189N_ALL_f06_1_1_1.000 1073.7Mb recalled: {f0b 13} raw019189N_ALL_f06_1_1_1.001 1073.7Mb recalled: {f0b 13} raw019189N_ALL_f06_1_1_1.002 1073.7Mb recalled: {f0b 13} raw019189N_ALL_f06_1_1_1.003 1073.3Mb recalled: {f0b 13} raw019189N_ALL_f07_1_1_1.000 1073.7Mb recalled: {f0b 13} raw019189N_ALL_f07_1_1_1.001 1073.7Mb recalled: {f0b 13} raw019189N_ALL_f07_1_1_1.002 1073.7Mb recalled: {f0b 15} raw019189N_ALL_f07_1_1_1.003 1073.7Mb recalled: {f0b 15} raw019189N_ALL_f07_1_1_1.004 6.3Mb recalled: {f0b 15} raw019191N_ALL_f05_1_1_1.000 1073.7Mb recalled: {f0b 15}
A more elaborate raw search:
kls -d -b raw "stream_code='ALL' and torta_name='2sect_DC2_c5' and Zero_Sup=1 and run_nr between 26000 and 26335" Found 28 files: recalled f0b 13 raw026010N_ALL_f06_1_1_1.004 recalled f0b 13 raw026010N_ALL_f06_1_1_1.005 recalled f0b 13 raw026010N_ALL_f06_1_1_1.006 recalled f0b 13 raw026019N_ALL_f05_1_1_1.000 recalled f0b 13 raw026019N_ALL_f05_1_1_1.001 recalled f0b 13 raw026019N_ALL_f06_1_1_1.000 recalled f0b 13 raw026019N_ALL_f06_1_1_1.001 recalled f0b 13 raw026019N_ALL_f06_1_1_1.002 recalled f0b 13 raw026019N_ALL_f06_1_1_1.003 recalled f0b 13 raw026019N_ALL_f06_1_1_1.004 online f07 1 raw026326N_ALL_f07_1_1_1.005 online f07 1 raw026326N_ALL_f07_1_1_1.006 online f05 1 raw026335N_ALL_f05_1_1_1.003 online f05 1 raw026335N_ALL_f05_1_1_1.004 online f05 1 raw026335N_ALL_f05_1_1_1.005 online f05 1 raw026335N_ALL_f05_1_1_1.006 online f06 1 raw026335N_ALL_f06_1_1_1.002 online f06 1 raw026335N_ALL_f06_1_1_1.003 online f06 1 raw026335N_ALL_f06_1_1_1.004 online f06 1 raw026335N_ALL_f06_1_1_1.005 online f06 1 raw026335N_ALL_f06_1_1_1.006 online f07 1 raw026335N_ALL_f07_1_1_1.000 online f07 1 raw026335N_ALL_f07_1_1_1.001 online f07 1 raw026335N_ALL_f07_1_1_1.002 online f07 1 raw026335N_ALL_f07_1_1_1.003 online f07 1 raw026335N_ALL_f07_1_1_1.004 online f07 1 raw026335N_ALL_f07_1_1_1.005 online f07 1 raw026335N_ALL_f07_1_1_1.006
A simple Monte Carlo query, with one file currently being copied and another under recall:
kls mc "mccard_code='kskl_2pi'" Found 10 files: rmc000001_kskl_2pi_14.mcr 1725.5Mb on tape rmc000002_kskl_2pi_14.mcr 1735.1Mb recalled: {f0a 13 (in use)}, {f0b 15 (recalling)} rmc000003_kskl_2pi_14.mcr 1715.4Mb on tape rmc000004_kskl_2pi_14.mcr 1714.5Mb on tape rmc000005_kskl_2pi_14.mcr 1721.4Mb on tape rmc000006_kskl_2pi_14.mcr 1708.0Mb on tape rmc000007_kskl_2pi_14.mcr 1721.3Mb recalled: {f0a 15 (recalling)} rmc000008_kskl_2pi_14.mcr 1692.4Mb on tape rmc000009_kskl_2pi_14.mcr 1716.7Mb on tape rmc000010_kskl_2pi_14.mcr 1713.0Mb on tape
None yet.
Please send questions to Igor Sfiligoi