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

1.1       casties     1: #!/bin/bash
                      2: 
                      3: VERSION="archivemany V0.1 (14.6.2005 ROC)"
                      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.1       casties    18: 
                     19: if [ ! -d $BASEDIR ]
                     20: then
                     21:     echo "ERROR: base directory $BASEDIR not found!"
                     22:     exit 1
                     23: fi
                     24: 
                     25: if [ ! -f $DIRLIST ]
                     26: then
                     27:     echo "ERROR: directory list file $DIRLIST not found!"
                     28:     exit 1
                     29: fi
                     30: 
                     31: cat $DIRLIST | while read DIR
                     32: do
                     33:     if [ -d "$BASEDIR/$DIR" ]
                     34:     then
                     35:    echo "archiving $DIR..."
1.2     ! casties    36:    if /usr/local/mpiwg/archive/archiver "$PARAM" "$BASEDIR/$DIR"
1.1       casties    37:    then
                     38:        echo "  done on `date`"
                     39:    else
                     40:        echo "FAILED!"
                     41:        # abort?
                     42:    fi
                     43:     else
                     44:    echo "ERROR: document directory $BASEDIR/$DIR not found!"
                     45:     fi
                     46: done

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