Annotation of foxridge-archiver/archivemany.sh, revision 1.3

1.1       casties     1: #!/bin/bash
                      2: 
1.3     ! casties     3: VERSION="archivemany V0.2 (23.9.2005 ROC)"
1.1       casties     4: 
1.2       casties     5: #set -x
                      6: 
1.1       casties     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"
1.2       casties    17: PARAM="$3"
1.3     ! casties    18: CNT="1"
1.1       casties    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
1.3     ! casties    36:    echo "archiving document $CNT: $DIR..."
1.2       casties    37:    if /usr/local/mpiwg/archive/archiver "$PARAM" "$BASEDIR/$DIR"
1.1       casties    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
1.3     ! casties    47:     CNT=$(( $CNT + 1 ))
1.1       casties    48: done

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