File:  [Repository] / foxridge-archiver / archivemany.sh
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Mon Jun 20 15:21:30 2005 UTC (19 years ago) by casties
Branches: MAIN
CVS tags: HEAD
new helper script for calling archiver on many directories

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

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