#!/bin/bash
#
# run MABackup from the jar file
#
if [ "$1" == '--help' ]
then
	script_help runSearch
	exit 0
fi

if [ -f ma/MailArchive.class ]
then
	launcher=ma/MailArchive
else
	launcher="-jar /usr/java/jarlib/MailArchive.jar"
fi

homedir=$(java $launcher MAParm home_directory)
if [ $? -ne 0 ]
then
	echo "Backup run abandoned"
	exit 1
fi

if [ -d $homedir ]
then
	cd $homedir
else
	echo "Error: can't change directory to $homedir"
	exit 1
fi

MEM=350m
java -Xmx$MEM $launcher MABackup \
     $1 $2 $3 $4 $5 $6 $7 $8 $9

#help
# Syntax:   runSearch [options]
# Function: Run MABackup from the MailArchive jar file
#           The jar and support jar files must be in /usr/java/jarlib
# Options:  See MABackup documentation
#end

