sam configure group --group=test --max-disk=20 --max-lock=0
--max-projects=5 --admin=lueking,terekhov,veseli,white
OK
Set up a disk cache, for the group algo, with 50G Bytes of space, no lock space and a maximum of 50 simultaneous running projects.
<d0mino> sam add group --group=algo --max-disk=50000000
--max-lock=0 --max-projeccts=50 --admin=lueking,terekhov,veseli,white
OK
Set up a disk cache, for the group emid, with 10G
Bytes of space, 10 GB lock space and a maximum of 10 simultaneous
running projects.
<d0mino> sam add group --group=emid --max-disk=10000000
--max-lock=10000000 --max-projects=10 --admin=lueking,terekhov,veseli,white
OK
Set up a disk cache, for the group emid, with 80G
Bytes of space, 80 GB lock space and a maximum of 10 simultaneous
running projects.
<d0mino> sam add group --group=cal --max-disk=80000000
--max-lock=80000000 --max-projects=10 --admin=lueking,terekhov,veseli,white
OK
In all of the above cases, the administrators are lueking,terekhov,veseli,white.
This means these are the
only people authorized to change the cache parameters
for a particular cache.
<d0mino> sam dump station --groups
*** BEGIN DUMP STATION = d0mino, id = 21, admins:
(empty)
Can go list: (empty)
Full delivery unit is enforced
AUTHORIZED GROUPS:
group algo: admins: lueking terekhov veseli
white , swap policy: LRU, quotas (cur/max): projects = 0/50, disk: 0/50000000
KB, locks:0/0 KB
group cal: admins: lueking terekhov veseli white , swap policy: LRU, quotas (cur/max): projects = 0/10, disk: 0/80000000 KB, locks:0/80000000 KB
group demo: admins: lueking terekhov veseli white , swap policy: LRU, quotas (cur/max): projects = 0/5, disk: 4998372/5000000 KB, locks:0/0 KB
group dzero: admins: lueking terekhov veseli white , swap policy: LRU, quotas (cur/max): projects = 0/20, disk: 0/150000000 KB, locks:19088799/100000000 KB
group emid: admins: lueking terekhov veseli white , swap policy: LRU, quotas (cur/max): projects = 0/10, disk: 0/10000000 KB, locks:0/10000000 KB
group test: admins: lueking terekhov veseli white , swap policy: LRU, quotas (cur/max): projects = 0/50, disk: 6573830/20000000 KB, locks:0/20000000 KB
To lock a set of files onto a cache area, you must
first create a project with the data you desire to be locked in it..
For example
sam define project --filename=file1,file2,file3,...,filen
--defname=project_name --group=group_name
The following sh script is an example of how the filees in this definition can be cached, and locked in the cache.
#!/bin/sh
#
# Purpose: Cache each file in a project, lock it
to disk after it arrives.
# Usage: cache_and_lock_projects project_definition_name
group [station]
# Author: Lee Lueking 04/07/2000
#
#
if $3 = ""
then
else
export SAM_STATION=$3
fi
defname=$1
export SAM_PROJECT=$defname_cache_lock_`date +%m_%d_%y_%H_%M_%S`
group=$2
cid_log=cid.log
pid_log=pid.log
file_log=file.log
echo " "
echo "Caching for project : $SAM_PROJECT"
sam start project --snapvers=new --defname=$defname
sam establish consumer --appfamily=test --version=1
--rtfile=$cid_log
sam establish process --cid=`cut -f2 -d' ' $cid_log`
--rtfile=$pid_log
nfiles=0
while [$file -ne "END_OF_STREAM"]
do
sam get next file --rtfile=$file_log
--cpid=`cut -f2 -d' ' $pid_log`
file=`cat $file_log
echo "Got file: $file`
echo "Locking file: $file"
sam lock file --file=$file --group=$group
sam release --file=$file --status=ok
--cpid=`cut -f2 -d' ' $pid_log`
nfiles=$[ $nfiles + 1 ]
done
sam stop project
echo " "
Use sam script as above, but insert "unlock" instead of "lock"