Using KanUserAdmin
The KanUserAdmin utility provides information about Kanga collections in the CM2
eventstore. It is intended only for use in performing very basic operations
on a CM2 eventstore (or portion thereof) which is entirely visible via
direct filesystem access (e.g. NFS or local disk). The primary use case
is the /work/users area at most Tier A sites.
You should find it as part of the release. For example, if your
test release is based on 14.5.2:
noric03> which KanUserAdmin
/afs/slac.stanford.edu/g/babar/dist/releases/14.5.2/bin/Linux24RH72_i386_gcc2953/KanUserAdmin
noric03>
otherwise, you can make it by
checking out the KanUtils package.
How to use KanUserAdmin
KanUserAdmin list < options > < arg1 > [< arg2 >] [....]
Prints the list of collections and directories in the specified
directory. For example
myrel/workdir> KanUserAdmin list /work/users/lange
/work/users/lange/0401/
/work/users/lange/040218/
/work/users/lange/SP5_031213/
/work/users/lange/ifr_031217s/
myrel/workdir> KanUserAdmin list /work/users/lange/SP5_031213/SP_2282890_c14.2.0b/
/work/users/lange/SP5_031213/SP_2282890_c14.2.0b//A0Kan
/work/users/lange/SP5_031213/SP_2282890_c14.2.0b//AllEventsKan
/work/users/lange/SP5_031213/SP_2282890_c14.2.0b//B0DKNeutKan
Using the -r option will all list collections in or beneath the
specified directory.
myrel/workdir> KanUserAdmin list -r /work/users/lange/SP5_031213/ | more
/work/users/lange/SP5_031213//SP_2282890_c14.2.0b/
/work/users/lange/SP5_031213//SP_2282890_c14.2.0b/A0Kan (1 files, 7074666 bytes)
/work/users/lange/SP5_031213//SP_2282890_c14.2.0b/AllEventsKan (1 files, 749618 bytes)
/work/users/lange/SP5_031213//SP_2282890_c14.2.0b/B0DKNeutKan (1 files, 4256544 bytes)
myrel/workdir>
KanUserAdmin delete < options > < coll1 > [< coll2 >] [....]
Delete the specified collections. All (owned) files for the collections
are deleted. Files from which the collections borrows components are not
touched.
noric> KanUserAdmin list /work/users/lange/14.4.2/elfevents
/work/users/lange/14.4.2/elfevents
noric> KanUserAdmin delete /work/users/lange/14.4.2/elfevents
/work/users/lange/14.4.2/elfevents (2 files, 1720845 bytes) - Deleted
KanUserAdmin del < options > < coll1 > [< coll2 >] [....]
Delete the specified collections. (Same as command "delete", see above)
KanUserAdmin mkdir < options > < dir1 > [< dir2 >] [....]
Creates the specified directory in collection space.
myrel/workdir> KanUserAdmin mkdir /work/users/lange/040410
myrel/workdir> KanUserAdmin list /work/users/lange
/work/users/lange/040410/
myrel/workdir>
KanUserAdmin rmdir < options > < dir1 > [< dir2 >] [....]
Removes the specified directory in collection space. All collections
in the directory must first be deleted, however. (See delete
and del above.)
KanUserAdmin createuser < options >
Creates the /work/users/ area for your account
KanUserAdmin help
Basic command line help printout for KanUserAdmin and its commands.
KanUserAdmin FAQ
Q: Can I use wildcards with KanUserAdmin? For
example, can I do something like the following?
KanUserAdmin delete /work/users/someuser/*
A: No, that will not work. KanUserAdmin doesn't currently support the
use of wildcards (and you'd probably have to add some quotes anyway
to prevent the shell itself from trying to expand the wildcard). An
alternate method to do what you want which will work is:
noric10> KanUserAdmin list /work/users/elmer/14.5.2-cand-1 | xargs KanUserAdmin delete
/work/users/elmer/14.5.2-cand-1/calibevents1 (1 files, 945745 bytes) - Deleted
/work/users/elmer/14.5.2-cand-1/elfevents1 (2 files, 2653977 bytes) - Deleted
/work/users/elmer/14.5.2-cand-1/mooseevents1 (2 files, 2591238 bytes) - Deleted
Q: How do I add KanUserAdmin to my test release?
A: In general you should be able to run it directly from the
release without checking it out in your test release. If you need
to check it out in your test release the following recipe can be
used.
From your test release, check out the KanUtils package. For
example, if your test release is based on 14.5.2, you will see
noric03> addpkg KanUtils
Offline Release 14.5.2 uses KanUtils version V01-01-08, will check that out
cvs checkout: Updating KanUtils
U KanUtils/GNUmakefile
U KanUtils/KanAccess.cc
U KanUtils/KanBbrRoot.cc
U KanUtils/KanBbrRoot.hh
U KanUtils/KanCollUtil.cc
U KanUtils/KanCopyUtil.cc
U KanUtils/KanFileLocater.cc
U KanUtils/KanFileLocater.hh
U KanUtils/KanFileUtil.cc
U KanUtils/KanRecover.cc
U KanUtils/KanTagCheck.cc
U KanUtils/KanUserAdmin
U KanUtils/KanUtils.cc
U KanUtils/KanUtils.hh
U KanUtils/KanUtilsProcs.tcl
U KanUtils/README
U KanUtils/bin_KanAccess.mk
U KanUtils/bin_KanCollUtil.mk
U KanUtils/bin_KanCopyUtil.mk
U KanUtils/bin_KanFileUtil.mk
U KanUtils/bin_KanRecover.mk
U KanUtils/bin_KanTagCheck.mk
U KanUtils/bin_KanUtils.mk
U KanUtils/binlist
U KanUtils/link_KanUtils.mk
U KanUtils/mergeExample.tcl
U KanUtils/mergePRExample.tcl
GNU Make version 3.79.1,
Build OPTIONS = Linux24RH72_i386_gcc2953-Debug-native-Objy-Optimize-Fastbuild-Ldlink2-SkipSlaclog-Static-Lstatic
Linux noric03 2.4.20-30HEP2.7smp #1 SMP Fri Feb 20 11:10:35 PST 2004 i686 unknown [uname -a]
-> installdirs:
noric03>
then,
noric03> gmake KanUtils.all
GNU Make version 3.79.1,
Build OPTIONS = Linux24RH72_i386_gcc2953-Debug-native-Objy-Optimize-Fastbuild-Ldlink2-SkipSlaclog-Static-Lstatic
Linux noric03 2.4.20-30HEP2.7smp #1 SMP Fri Feb 20 11:10:35 PST 2004 i686 unknown [uname -a]
-> KanUtils.all: (Wed May 5 10:48:36 PDT 2004)
Making KanUtils.d [cc1]
Making KanFileLocater.d [cc1]
Making KanBbrRoot.d [cc1]
Making KanTagCheck.d [cc3]
Making KanRecover.d [cc3]
Making KanAccess.d [cc3]
Making KanCopyUtil.d [cc3]
Making KanCollUtil.d [cc3]
Making KanFileUtil.d [cc3]
corba stage done in /afs/slac.stanford.edu/u/ec/elmer/work/14.5.2/KanUtils
Compiling KanBbrRoot.cc [libKanUtils.a] [cc-1]
Compiling KanFileLocater.cc [libKanUtils.a] [cc-1]
Compiling KanUtils.cc [libKanUtils.a] [cc-1]
Collecting /afs/slac.stanford.edu/u/ec/elmer/work/14.5.2/tmp/Linux24RH72_i386_gcc2953/KanUtils/obj/*.o to library /afs/slac.stanford.edu/u/ec/elmer/work/14.5.2/lib/Linux24RH72_i386_gcc2953/libKanUtils.a [lib-1]
lib stage done in /afs/slac.stanford.edu/u/ec/elmer/work/14.5.2/KanUtils
Compiling KanFileUtil.cc [KanFileUtil.o] [cc-3]
Compiling KanCollUtil.cc [KanCollUtil.o] [cc-3]
Compiling KanCopyUtil.cc [KanCopyUtil.o] [cc-3]
Compiling KanAccess.cc [KanAccess.o] [cc-3]
Compiling KanRecover.cc [KanRecover.o] [cc-3]
Compiling KanTagCheck.cc [KanTagCheck.o] [cc-3]
Linking KanFileUtil in KanUtils [link-1]
/afs/.slac.stanford.edu/package/gcc/i386_linux22/gcc-2.95.3/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libg2c.a(open.o): In function `f_open':
/u/sf/bartelt/RWPackage/gcc/build/gcc-2.95.3/i686-pc-linux-gnu/libf2c/libI77/../../../../../src/gcc-2.95.3/libf2c/libI77/open.c:213: the use of `tempnam' is dangerous, better use `mkstemp'
Linking KanCollUtil in KanUtils [link-1]
/afs/.slac.stanford.edu/package/gcc/i386_linux22/gcc-2.95.3/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libg2c.a(open.o): In function `f_open':
/u/sf/bartelt/RWPackage/gcc/build/gcc-2.95.3/i686-pc-linux-gnu/libf2c/libI77/../../../../../src/gcc-2.95.3/libf2c/libI77/open.c:213: the use of `tempnam' is dangerous, better use `mkstemp'
Linking KanCopyUtil in KanUtils [link-1]
/afs/.slac.stanford.edu/package/gcc/i386_linux22/gcc-2.95.3/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libg2c.a(open.o): In function `f_open':
/u/sf/bartelt/RWPackage/gcc/build/gcc-2.95.3/i686-pc-linux-gnu/libf2c/libI77/../../../../../src/gcc-2.95.3/libf2c/libI77/open.c:213: the use of `tempnam' is dangerous, better use `mkstemp'
Linking KanAccess in KanUtils [link-1]
Linking KanRecover in KanUtils [link-1]
/afs/.slac.stanford.edu/package/gcc/i386_linux22/gcc-2.95.3/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libg2c.a(open.o): In function `f_open':
/u/sf/bartelt/RWPackage/gcc/build/gcc-2.95.3/i686-pc-linux-gnu/libf2c/libI77/../../../../../src/gcc-2.95.3/libf2c/libI77/open.c:213: the use of `tempnam' is dangerous, better use `mkstemp'
Linking KanTagCheck in KanUtils [link-1]
/afs/.slac.stanford.edu/package/gcc/i386_linux22/gcc-2.95.3/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libg2c.a(open.o): In function `f_open':
/u/sf/bartelt/RWPackage/gcc/build/gcc-2.95.3/i686-pc-linux-gnu/libf2c/libI77/../../../../../src/gcc-2.95.3/libf2c/libI77/open.c:213: the use of `tempnam' is dangerous, better use `mkstemp'
Mangling KanUserAdmin to binary directory [binscripts-1]
bin stage done in /afs/slac.stanford.edu/u/ec/elmer/work/14.5.2/KanUtils
then you should see it under your bin directory
noric03> which KanUserAdmin
./bin/Linux24RH72_i386_gcc2953/KanUserAdmin
noric03>