changeset 15:8d2f0586eca6

new helper script for calling archiver on many directories
author casties
date Mon, 20 Jun 2005 17:21:30 +0200
parents 018e7c913b32
children 8eee361fdec8
files archivemany.sh makemeta-lib.pl unarchivemany.sh
diffstat 3 files changed, 87 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/archivemany.sh	Mon Jun 20 17:21:30 2005 +0200
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+VERSION="archivemany V0.1 (14.6.2005 ROC)"
+
+if [ -z "$1$2" ]
+then
+    echo $VERSION
+    echo "use: $0 docdir dirlist"
+    echo "  Archives the directories given in the file dirlist inside docdir."
+    exit 1
+fi
+
+BASEDIR="$1"
+DIRLIST="$2"
+
+if [ ! -d $BASEDIR ]
+then
+    echo "ERROR: base directory $BASEDIR not found!"
+    exit 1
+fi
+
+if [ ! -f $DIRLIST ]
+then
+    echo "ERROR: directory list file $DIRLIST not found!"
+    exit 1
+fi
+
+cat $DIRLIST | while read DIR
+do
+    if [ -d "$BASEDIR/$DIR" ]
+    then
+	echo "archiving $DIR..."
+	if /usr/local/mpiwg/archive/archiver "$BASEDIR/$DIR"
+	then
+	    echo "  done on `date`"
+	else
+	    echo "FAILED!"
+	    # abort?
+	fi
+    else
+	echo "ERROR: document directory $BASEDIR/$DIR not found!"
+    fi
+done
--- a/makemeta-lib.pl	Wed Jun 01 14:26:52 2005 +0200
+++ b/makemeta-lib.pl	Mon Jun 20 17:21:30 2005 +0200
@@ -94,6 +94,7 @@
     'French' => 'fr',
     'Latin' => 'la',
     'Japanese' => 'ja',
+    'Dutch' => 'nl',
     'Spanish' => 'es'
     );
 # storage fields
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/unarchivemany.sh	Mon Jun 20 17:21:30 2005 +0200
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+VERSION="unarchivemany V0.1 (14.6.2005 ROC)"
+
+if [ -z "$1$2" ]
+then
+    echo $VERSION
+    echo "use: $0 docdir dirlist"
+    echo "  Unrchives the directories given in the file dirlist inside docdir."
+    exit 1
+fi
+
+BASEDIR="$1"
+DIRLIST="$2"
+
+if [ ! -d $BASEDIR ]
+then
+    echo "ERROR: base directory $BASEDIR not found!"
+    exit 1
+fi
+
+if [ ! -f $DIRLIST ]
+then
+    echo "ERROR: directory list file $DIRLIST not found!"
+    exit 1
+fi
+
+cat $DIRLIST | while read DIR
+do
+    if [ -d "$BASEDIR/$DIR" ]
+    then
+	echo "archiving $DIR..."
+	if /usr/local/mpiwg/archive/unarchiver "$BASEDIR/$DIR"
+	then
+	    echo "  done on `date`"
+	else
+	    echo "FAILED!"
+	    # abort?
+	fi
+    else
+	echo "ERROR: document directory $BASEDIR/$DIR not found!"
+    fi
+done