File:  [Repository] / foxridge-archiver / archivemany.sh
Revision 1.3: download - view: text, annotated - select for diffs - revision graph
Fri Sep 23 17:16:16 2005 UTC (18 years, 9 months ago) by casties
Branches: MAIN
CVS tags: HEAD
added count in archivemany
removed abort on wrong user in archiver (problem with screen)

    1: #!/bin/bash
    2: 
    3: VERSION="archivemany V0.2 (23.9.2005 ROC)"
    4: 
    5: #set -x
    6: 
    7: if [ -z "$1$2" ]
    8: then
    9:     echo $VERSION
   10:     echo "use: $0 docdir dirlist"
   11:     echo "  Archives the directories given in the file dirlist inside docdir."
   12:     exit 1
   13: fi
   14: 
   15: BASEDIR="$1"
   16: DIRLIST="$2"
   17: PARAM="$3"
   18: CNT="1"
   19: 
   20: if [ ! -d $BASEDIR ]
   21: then
   22:     echo "ERROR: base directory $BASEDIR not found!"
   23:     exit 1
   24: fi
   25: 
   26: if [ ! -f $DIRLIST ]
   27: then
   28:     echo "ERROR: directory list file $DIRLIST not found!"
   29:     exit 1
   30: fi
   31: 
   32: cat $DIRLIST | while read DIR
   33: do
   34:     if [ -d "$BASEDIR/$DIR" ]
   35:     then
   36: 	echo "archiving document $CNT: $DIR..."
   37: 	if /usr/local/mpiwg/archive/archiver "$PARAM" "$BASEDIR/$DIR"
   38: 	then
   39: 	    echo "  done on `date`"
   40: 	else
   41: 	    echo "FAILED!"
   42: 	    # abort?
   43: 	fi
   44:     else
   45: 	echo "ERROR: document directory $BASEDIR/$DIR not found!"
   46:     fi
   47:     CNT=$(( $CNT + 1 ))
   48: done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>