From c080fc5219cf624f99d74949c0b3031d08008769 Mon Sep 17 00:00:00 2001 From: Gerolf Ziegenhain Date: Sat, 31 Jan 2009 11:44:02 +0100 Subject: [PATCH] . --- .../cluster/cluster-utils/DEBIAN/control | 2 +- .../queue-utils/usr/share/doc/queue-utils/.keep | 0 .../cluster_raw_old/opt/cluster/sbin/cl-backup | 13 - .../cluster_raw_old/opt/cluster/sbin/cl-filewatch | 36 - .../cluster_raw_old/opt/cluster/sbin/rgang | 3 - .../cluster_raw_old/opt/cluster/sbin/rgang.py | 1570 -------------------- 6 files changed, 1 insertion(+), 1623 deletions(-) mode change 100644 => 100755 var/deb-package/cluster/queue-utils/usr/share/doc/queue-utils/.keep delete mode 100755 var/deb-package/cluster_raw_old/opt/cluster/sbin/cl-backup delete mode 100755 var/deb-package/cluster_raw_old/opt/cluster/sbin/cl-filewatch delete mode 100755 var/deb-package/cluster_raw_old/opt/cluster/sbin/rgang delete mode 100755 var/deb-package/cluster_raw_old/opt/cluster/sbin/rgang.py diff --git a/var/deb-package/cluster/cluster-utils/DEBIAN/control b/var/deb-package/cluster/cluster-utils/DEBIAN/control index acb1e48..1b3d97c 100755 --- a/var/deb-package/cluster/cluster-utils/DEBIAN/control +++ b/var/deb-package/cluster/cluster-utils/DEBIAN/control @@ -1,6 +1,6 @@ Package: cluster-utils Version: 0.0.2 -Depends: pymol, finger, tcpdump, imagemagick, w32codecs, mencoder, mplayer, zsh, bash, csh, ash +Depends: pymol, finger, tcpdump, imagemagick, w32codecs, mencoder, mplayer, zsh, bash, csh, ash, queue-utils, rgang Essential: no Priority: standard Section: corvix diff --git a/var/deb-package/cluster/queue-utils/usr/share/doc/queue-utils/.keep b/var/deb-package/cluster/queue-utils/usr/share/doc/queue-utils/.keep old mode 100644 new mode 100755 diff --git a/var/deb-package/cluster_raw_old/opt/cluster/sbin/cl-backup b/var/deb-package/cluster_raw_old/opt/cluster/sbin/cl-backup deleted file mode 100755 index f3dc1a4..0000000 --- a/var/deb-package/cluster_raw_old/opt/cluster/sbin/cl-backup +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/zsh -. /opt/cluster/lib/common.shell - -LOG "Backing up" -for trg in /mnt/nas3/cluster/ desiato.physik.uni-kl.de:/mnt/vol1/cluster/; do - LOG "Backup to $trg" - rsync -zavP \ - --exclude /mnt --exclude /sys --exclude /dev --exclude /proc --exclude /home \ - /. $trg/head/. - rsync -zavP \ - --exclude /mnt --exclude /sys --exclude /dev --exclude /proc --exclude /home \ - /mnt/golden-node/. $trg/node/. -done diff --git a/var/deb-package/cluster_raw_old/opt/cluster/sbin/cl-filewatch b/var/deb-package/cluster_raw_old/opt/cluster/sbin/cl-filewatch deleted file mode 100755 index 5d1d749..0000000 --- a/var/deb-package/cluster_raw_old/opt/cluster/sbin/cl-filewatch +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/zsh -. /etc/cluster/common.shell - -MAXTIME=60 #days -MAXSIZE=30 #mb - -WD=/var/cluster - -find_files() { - MNT=$1 - echo "Looking for old files in $MNT" - find /mnt/$MNT -mtime +$MAXTIME -size +${MAXSIZE}M > $WD/evil_files.$MNT -} - -calc_quota() { - MNT=$1 - echo "Users quota in $MNT" - rm quota.$MNT - USERS=$(cat $WD/evil_files.$MNT | sed 's/\.\///g;s/\// /g' | awk '{print$3}' | sort | awk 'n!=$1{print$1;n=$1}') - for u in $(echo $USERS); do - cat $WD/evil_files.$MNT | grep $u 2>/dev/null >$WD/$u.$MNT.files - size=0 - for f in $(cat $WD/$u.$MNT.files); do - [[ ! -e $f ]] && continue - size=$(( $size + $(ls -la $f | awk '{print$5/(1024.**3)}') )) - done - echo $u $size >> quota.$MNT - done - cat quota.$MNT -} - -for fs in nas1 nas2 gfs; do - find_files $fs - calc_quota $fs -done - diff --git a/var/deb-package/cluster_raw_old/opt/cluster/sbin/rgang b/var/deb-package/cluster_raw_old/opt/cluster/sbin/rgang deleted file mode 100755 index f36a9b2..0000000 --- a/var/deb-package/cluster_raw_old/opt/cluster/sbin/rgang +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -exec python /opt/cluster/sbin/rgang.py --rcp=scp --rsh=ssh "$@" - diff --git a/var/deb-package/cluster_raw_old/opt/cluster/sbin/rgang.py b/var/deb-package/cluster_raw_old/opt/cluster/sbin/rgang.py deleted file mode 100755 index 55bbdb5..0000000 --- a/var/deb-package/cluster_raw_old/opt/cluster/sbin/rgang.py +++ /dev/null @@ -1,1570 +0,0 @@ -#!/usr/bin/env python -# This file (rgang.py) was created by Ron Rechenmacher on -# Apr 13, 2001. "TERMS AND CONDITIONS" governing this file are in the README -# or COPYING file. If you do not have such a file, one can be obtained by -# contacting Ron or Fermi Lab in Batavia IL, 60510, phone: 630-840-3000. -# $RCSfile: rgang.py,v $ $Revision: 1.112 $ $Date: 2005/05/04 17:25:34 $ - -import os.path # basename -import sys # argv -import re # findall -import string # split -import time # time - -DFLT_RSH='rsh' -DFLT_RCP='rcp' -DFLT_RSHTO='150.0' # float seconds (basically, let the user decide) -DFLT_RCPTO='3600.0' # float seconds (big files?) (basically, let the user decide) - -VERSION='2.7 cvs: $Revision: 1.112 $$Date: 2005/05/04 17:25:34 $' -APP = os.path.basename( sys.argv[0] ) -USAGE=\ -"%s: run cmds on hosts\n"%(APP,)+\ -"Usage: %s [options] [cmd]\n"%(APP,)+\ -" %s [options] - 'srcfile' 'dstdfile'\n"%(APP,)+\ -" %s [--skip ] --list []\n"%(APP,)+\ -" %s -d\n"%(APP,)+\ -" nodespec can be a \"farmlet\", \"expandable node list\", or \"-\".\n"+\ -" when nodespec is \"-\", nodes are read from stdin (1 per line)\n"+\ -" until a line containing a single \".\" is encountered\n"+\ -" The nodespec is evaluated in the following order:\n"+\ -" is it the stdin (\"-\")\n"+\ -" it it a file in \"farmlets\" directory\n"+\ -" it it a file in current working directory\n"+\ -" assume \"expandable node list\"\n"+\ -"Examples: %s -c root@qcd01{01-4} .profile .\n"%(APP,)+\ -" %s all ls\n"%(APP,)+\ -" %s all \"echo 'hi there'\"\n"%(APP,)+\ -" %s qcd01{01-4} '%s qcd01{01-4} \"echo hi\"'\n"%(APP,APP)+\ -" %s -l root qcd0{1-2}{04-10} \"echo 'hi there'\"\n"%(APP,)+\ -" %s --skip node0{b-d} --list \"node{04-0x44,4f-0x55}\"\n"%(APP,)+\ -" to test a large # of nodes:\n"+\ -" %s 'qcd{,,,}{01-8}{01-10}' echo hi\n"%(APP,)+\ -"Note: when using node expansion, don't forget to quote the expression to\n"+\ -" stop shell expansion (as bash would do with the \"{,}\" syntax in\n"+\ -" above example)" -# For the following, the definitions are: -# 'desc' Short description; printed out along with "USAGE" -# 'init' The initialized value, i.e. when option is not specified; -# usually string, but can be other if accompanied by specific -# processing (default='') -# 'alias' a list of aliases (i.e. short form?) -# 'arg' the type of option argument: -# an integer -# 0 => option does not take an argument (default) -# 1 => option does take an argument -# 2 => option takes an optional argument where if it is -# multiple leter (long [--] form) option there must -# be an '=', else if it is a single letter, -# the arg will follow -# 'opt' for optional argument type options (arg=2), the -# value of the option when specified without an argument -OPTSPEC={ 'd':{'desc':"List farmlet names"}, - 's':{'desc':"Skip current (local) node"}, - 'c':{'desc':"Copy input output"}, - 'C':{'desc':"Copy and skip current (local) node. Equiv to -sc"}, - 'p':{'desc':"Same as rcp -p (only applicable if -c/C)"}, - 'l':{'desc':"Same as rsh -l (only applicable if not -c/C)",'arg':1}, - 'x':{'desc':"Same as rsh/rcp -x (turns on encryption)"}, - 'X':{'desc':"Same as rsh/rcp -X (turns off encryption)"}, - 'f':{'desc':"Same as rsh -f (cause nonforwardable credentials to be forwarded)"}, - 'F':{'desc':"Same as rsh/rcp -F (cause forwardable credentials to be forwarded)"}, - 'N':{'desc':"Same as rsh/rcp -N (prevent credentials from being forwarded)"}, - 'n':{'desc':"-n or -n0: no header, -n1 or -nn: node=, -n2: ---, -n3: --- and cmd", - 'arg':2,'init':'','opt':'0'}, - 'list' :{'desc':"list farmlets (there contents)"}, - 'farmlets':{'desc':"override farmlets dir /opt/cluster/etc/rgang", - 'arg':1,'init':'/opt/cluster/etc/rgang'}, - 'serial' :{'desc':"do not fork all commands before reading output"}, - 'skip' :{'desc':'skip this specific list of nodes','arg':1}, - 'rsh' :{'desc':'override default rsh','arg':1,'init':DFLT_RSH}, - 'rcp' :{'desc':'override default rcp','arg':1,'init':DFLT_RCP}, - 'nway' :{'desc':'number of branches for each node of the tree OR if --serial, # of groups (def=200)', - 'arg':1,'init':200}, - 'combine' :{'desc':"spawn commands with stderr dupped onto stdout"}, - 'do-local':{'desc':"do 1st node in current (local) environment; do not rsh"}, - 'tlvlmsk' :{'desc':"debugging; set hex debug mask i.e. 0xf, \"1<<9\"",'arg':2,'opt':1,'init':'0'}, - 'pty' :{'desc':"use pseudo term -- good for when ssh wants passwd"}, - 'rshto' :{'desc':"change the default timeout value %s (float seconds) for non-copy"%DFLT_RSHTO, - 'arg':1,'init':DFLT_RSHTO}, - 'rcpto' :{'desc':"change the default timeout value %s (float seconds) for the copy"%DFLT_RCPTO, - 'arg':1,'init':DFLT_RCPTO}, - 'err-file':{'desc':"file to write timedout/error nodes to (could be used for retry)", - 'arg':1}, - 'verbose' :{'desc':"verbose",'alias':['v']}, - 'pyret' :{'desc':"don't output to stdout/err (used when rgang is imported in other .py scripts)"}, - 'pyprint' :{'desc':"implies pyret but *final* result is printed"}, - 'pypickle':{'desc':"implies pyret but *final* result is pickled and printed (preceeded by 8 length characters)"}, - 'path' :{'desc':"prepend to path when rsh rgang",'arg':1,'init':os.path.abspath(os.path.dirname(sys.argv[0]))}, - 'app' :{'desc':"change application name from default \"%s\" (use when call from script)"%(APP,),'arg':1,'init':APP}, - 'input-to-all-branches' :{'desc':"send input to all branches, not just currently processed"}, - 'adjust-copy-args':{'desc':"internal - applicable for \"-c\" (copy-mode)"}, - 'mach_idx_offset' :{'desc':"internal - used to determine \"root\" machine",'arg':1}, - } - - -def getopts( optspec, argv, usage_in, app, version='' ): - import os # environ - import string # replace, split - import sys # exit - import re # sub - optspec.update( {'help' :{'alias':['h','?'],'desc':'print usage/help'}} ) - optspec.update( {'version':{'alias':['V'],'desc':'print cvs version/date'}} ) - opt_map={} # handles aliases - opt={} # local master options dictionary - long_opts = []; env_opts = [] - for op in optspec.keys(): - default = {'desc':'', 'init':'', 'alias':[], 'arg':0, 'opt':''} - default.update( optspec[op] ); optspec[op].update( default ) - opt_map[op] = op; dashes='-' - if len(op) > 1: long_opts.append(op); dashes='--' - for alias in optspec[op]['alias']: - opt_map[alias] = op - if len(alias) > 1: long_opts.append(alias) - env=string.upper(re.sub('[.-]','_',app)+'_'+string.replace(op,'-','_')) - if env in os.environ.keys(): - if optspec[op]['arg']: - ee=os.environ[env] - opt[op]=ee; env_opts.append(dashes+op+'='+ee) - else: opt[op]='1'; env_opts.append(dashes+op) - else: opt[op]=optspec[op]['init'] - usage_out = usage_in+"\n\ -Note: all options can be specified via environment variables of the form\n\ - %s_