#!/bin/bash
source $(cd `dirname $0`; pwd)/common
parameterSize=2

if [ $# = 0 ]
then
	echo "全量备份工具（仅对数据库进行全量备份，未涉及控制文件和redo.record）需要参数："
	echo "1. 数据库目录，一般是名称为 “database” 的目录；"
	echo "2. 备份的目标目录。"
else
    needStopServer   #需要停止服务才能使用该工具
    if [ $? = 1 ]
    then
	    if [ $# != $parameterSize ]
	    then
	    	echo "参数个数不对。"
	    else
	    	java -classpath "$basePath/$version/lib/*:." kd.bos.olap.repairTools.OlapServerToolsMain -allowRunWithDatabase:true -function:totalBackup -functionParameters:$(getAbsolutePath $1),$(getAbsolutePath $2)
	    fi
	fi
fi