diff options
author | 2018-08-13 05:32:35 -0400 | |
---|---|---|
committer | 2018-08-13 14:09:01 -0400 | |
commit | 16700753dcf0e3600f600b0b769c89eb2273f1d6 (patch) | |
tree | f1d2d285f0be3a739135b4cc6b5c3eb2774c7573 /src/main/scripts/dataSnapshot.sh | |
parent | 3889e9be653a7c284986b2830aa02252fb6485fe (diff) |
Initial seed code for graphadmin
Issue-ID: AAI-1469
Change-Id: Ic170c326ad1fe4b43960de674797766f6f7b94bf
Signed-off-by: Kajur, Harish (vk250x) <vk250x@att.com>
Diffstat (limited to 'src/main/scripts/dataSnapshot.sh')
-rw-r--r-- | src/main/scripts/dataSnapshot.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/scripts/dataSnapshot.sh b/src/main/scripts/dataSnapshot.sh new file mode 100644 index 0000000..f380e85 --- /dev/null +++ b/src/main/scripts/dataSnapshot.sh @@ -0,0 +1,28 @@ +#!/bin/ksh +# +# This script invokes the dataSnapshot java class passing an option to tell it to take +# a snapshot of the database and store it as a single-line XML file. +# +# +# +# +# +COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P ) +. ${COMMON_ENV_PATH}/common_functions.sh + +processStat=$(ps -ef | grep '[D]ataSnapshot'); +if [ "$processStat" != "" ] + then + echo "Found dataSnapshot is already running: " $processStat + exit 1 +fi + +# TODO: There is a better way where you can pass in the function +# and then let the common functions check if the function exist and invoke it +# So this all can be templated out +start_date; +check_user; +source_profile; +execute_spring_jar org.onap.aai.datasnapshot.DataSnapshot $PROJECT_HOME/resources/logback.xml "$@" +end_date; +exit 0 |