Revision: 2086
http://archive-access.svn.sourceforge.net/archive-access/?rev=2086&view=rev
Author: bradtofel
Date: 2007-11-27 18:50:25 -0800 (Tue, 27 Nov 2007)
Log Message:
-----------
INITIAL REV: command line access to org.archive.wayback.resourcestore.WarcIndexer main()
Added Paths:
-----------
trunk/archive-access/projects/wayback/dist/src/scripts/warc-indexer
Added: trunk/archive-access/projects/wayback/dist/src/scripts/warc-indexer
===================================================================
--- trunk/archive-access/projects/wayback/dist/src/scripts/warc-indexer (rev 0)
+++ trunk/archive-access/projects/wayback/dist/src/scripts/warc-indexer 2007-11-28 02:50:25 UTC (rev 2086)
@@ -0,0 +1,82 @@
+#!/usr/bin/env sh
+##
+## This script creates a CDX file for all ARC files in a directory
+## PUTs those CDX files into a remote pipeline, and informs a remote
+## LocationDB of the locations of all the ARC files.
+##
+## Optional environment variables
+##
+## JAVA_HOME Point at a JDK install to use.
+##
+## WAYBACK_HOME Pointer to your wayback install. If not present, we
+## make an educated guess based of position relative to this
+## script.
+##
+## JAVA_OPTS Java runtime options. Default setting is '-Xmx256m'.
+##
+
+# Resolve links - $0 may be a softlink
+PRG="$0"
+while [ -h "$PRG" ]; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '.*/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`/"$link"
+ fi
+done
+PRGDIR=`dirname "$PRG"`
+
+# Set WAYBACK_HOME.
+if [ -z "$WAYBACK_HOME" ]
+then
+ WAYBACK_HOME=`cd "$PRGDIR/.." ; pwd`
+fi
+
+# Find JAVA_HOME.
+if [ -z "$JAVA_HOME" ]
+then
+ JAVA=`which java`
+ if [ -z "$JAVA" ]
+ then
+ echo "Cannot find JAVA. Please set JAVA_HOME or your PATH."
+ exit 1
+ fi
+ JAVA_BINDIR=`dirname $JAVA`
+ JAVA_HOME=$JAVA_BINDIR/..
+fi
+
+if [ -z "$JAVACMD" ]
+then
+ # It may be defined in env - including flags!!
+ JAVACMD=$JAVA_HOME/bin/java
+fi
+
+# Ignore previous classpath. Build one that contains heritrix jar and content
+# of the lib directory into the variable CP.
+for jar in `ls $WAYBACK_HOME/lib/*.jar $WAYBACK_HOME/*.jar 2> /dev/null`
+do
+ CP=${CP}:${jar}
+done
+
+# cygwin path translation
+if expr `uname` : 'CYGWIN*' > /dev/null; then
+ CP=`cygpath -p -w "$CP"`
+ WAYBACK_HOME=`cygpath -p -w "$WAYBACK_HOME"`
+fi
+
+# Make sure of java opts.
+if [ -z "$JAVA_OPTS" ]
+then
+ JAVA_OPTS=" -Xmx256m"
+fi
+
+# Main ArcIndexer class.
+if [ -z "$CLASS_MAIN" ]
+then
+ CLASS_MAIN='org.archive.wayback.resourcestore.WarcIndexer'
+fi
+
+CLASSPATH=${CP} $JAVACMD ${JAVA_OPTS} $CLASS_MAIN $@
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|