File:  [Repository] / foxridge-archiver / archivemany.sh
Revision 1.4: download - view: text, annotated - select for diffs - revision graph
Wed Oct 5 13:35:12 2005 UTC (18 years, 9 months ago) by casties
Branches: MAIN
CVS tags: HEAD
more option passing to metacheck from archivemany via archiver

    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: PARAM1="$3"
   18: PARAM2="$4"
   19: PARAM3="$5"
   20: CNT="1"
   21: 
   22: if [ ! -d $BASEDIR ]
   23: then
   24:     echo "ERROR: base directory $BASEDIR not found!"
   25:     exit 1
   26: fi
   27: 
   28: if [ ! -f $DIRLIST ]
   29: then
   30:     echo "ERROR: directory list file $DIRLIST not found!"
   31:     exit 1
   32: fi
   33: 
   34: cat $DIRLIST | while read DIR
   35: do
   36:     if [ -d "$BASEDIR/$DIR" ]
   37:     then
   38: 	echo "archiving document $CNT: $DIR..."
   39: 	if /usr/local/mpiwg/archive/archiver "$PARAM1" "$PARAM2" "$PARAM3" "$BASEDIR/$DIR"
   40: 	then
   41: 	    echo "  done on `date`"
   42: 	else
   43: 	    echo "FAILED!"
   44: 	    # abort?
   45: 	fi
   46:     else
   47: 	echo "ERROR: document directory $BASEDIR/$DIR not found!"
   48:     fi
   49:     CNT=$(( $CNT + 1 ))
   50: done

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