2 #############################################################################
3 # alifs - a front-end shell for CASTOR and SHIFT
4 #############################################################################
8 # Revision 1.1 2001/02/23 17:33:40 buncic
9 # Added alifs wrapper for CASTOR and alirun modified accordingly.
13 # alifs [flags] <command [options]>
15 # File System implementation:
17 # mv oldname newname...
18 # rm [-f] [-i] [-r] dirname...
19 # mkdir [-m absolute_mode] [-p] dirname...
23 # CASTOR implementation:
24 # ls [-cdilRTu] [--class] [--comment] path
25 # mv oldname newname...
26 # rm [-f] [-i] [-r] dirname...
27 # mkdir [-m absolute_mode] [-p] dirname...
28 # cp [-s maxsize] f1 f2
32 # This is an interface script to underlying mass storage manager. At present it supports CASTOR on RH6.1 and offers some basic Unix like commands:
35 # alifs ls [-cdilRTu] [--class] [--comment] path
37 # o) move (rename) file or directory
38 # alifs mv oldname newname...
40 # o) remove file or directory
41 # alifs rm [-f] [-i] [-r] dirname...
44 # alifs mkdir [-m absolute_mode] [-p] dirname...
47 # alifs cp [-s maxsize] f1 f2
50 # CASTOR file system is accessible via RFIO (root must be configured configured with --enable-rfio switch and linked with appropriate libshift.a library). It provides experiment topl level directory (/castor/cern.ch/alice) and user directories following the AFS naming scheeme (like /castor/cern.ch/user/b/buncic).
51 #For more info on CASTOR commands, see related man pages (nsls, nsrename, nsrm, nsmkdir,rfcp,rfstat).
55 # Predrag Buncic, e-mail: Predrag.Buncic@cern.ch
60 ###########################################################################
61 ALIFSDIR=`dirname $0`; export ALIFSDIR
62 ###########################################################################
67 if [ -f $ALIFSDIR/castor.sh ]
71 printf "Cannot find %s file. Terminating..." $ALIFSDIR/castor.sh
76 if [ -f $ALIFSDIR/rfio.sh ]
80 printf "Cannot find %s file. Terminating...\n" $ALIFSDIR/rfio.sh
88 if [ "$EXEC_SHELL" = "" ]
91 for shell in bash zsh ksh
93 for dir in /bin /usr/bin /usr/local/bin
97 EXEC_SHELL=$dir/$shell
103 exec $EXEC_SHELL -norc -noprofile $0 $*
106 ###########################################################################
109 printf "\nFile System Implementation:\n\n"
110 printf "Usage: alifs [-help][-p <pool>] <command [options]> \n"
111 printf " [-cdilRu] path \n"
112 printf " mv oldname newname... \n"
113 printf " rm [-f] [-i] [-r] dirname... \n"
114 printf " mkdir [-m absolute_mode] [-p] dirname...\n"
115 printf " cp f1 f2 \n"
116 printf " cp f1 <dir2> \n"
119 ###########################################################################
121 ###########################################################################
127 [ ! -d $mandir ] && mkdir -p $mandir
128 mv `basename $0`.? $mandir
132 ###########################################################################
137 ###########################################################################
142 ###########################################################################
147 ###########################################################################
152 ###########################################################################
157 ###########################################################################
159 ###########################################################################
164 case `type -t ALIFS_$cmd` in
175 ###########################################################################
177 ###########################################################################
207 ###########################################################################
209 ###########################################################################