From f7dc0ae9ea1818c4285f454a35a323310a72a6bc Mon Sep 17 00:00:00 2001 From: Venkata Harish K Kajur Date: Thu, 2 Nov 2017 09:11:31 -0400 Subject: [PATCH] Add the crontab for aai to save the datasnapshot every hour so the clients won't accidentally lose data Issue-ID: AAI-447 Change-Id: I527307e33dac3550e372d0117c5a4f6ecc320d37 Signed-off-by: Venkata Harish K Kajur --- aaicron.sh | 7 +++++++ aaicrontab | 1 + deploy_vm1.sh | 2 ++ 3 files changed, 10 insertions(+) create mode 100644 aaicron.sh create mode 100644 aaicrontab diff --git a/aaicron.sh b/aaicron.sh new file mode 100644 index 0000000..f977ebf --- /dev/null +++ b/aaicron.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +RESOURCES_COUNT=$(docker ps | grep 'testconfig_aai-resources.api.simpledemo.openecomp.org_1' | wc -l); + +if [ ${RESOURCES_COUNT} -eq 0 ]; then + docker exec -u aaiadmin testconfig_aai-resources.api.simpledemo.openecomp.org_1 /opt/app/aai-resources/bin/dataSnapshot.sh >> /var/log/aaicron.log 2>&1 +fi; diff --git a/aaicrontab b/aaicrontab new file mode 100644 index 0000000..56d2b41 --- /dev/null +++ b/aaicrontab @@ -0,0 +1 @@ +0 * * * * /bin/bash /opt/test-config/aaicron.sh diff --git a/deploy_vm1.sh b/deploy_vm1.sh index 5813119..087f8bf 100755 --- a/deploy_vm1.sh +++ b/deploy_vm1.sh @@ -149,3 +149,5 @@ $DOCKER_COMPOSE_CMD up -d sparky-be $DOCKER_COMPOSE_CMD up -d model-loader datarouter aai.searchservice.simpledemo.openecomp.org echo "A&AI Microservices are successfully started"; + +crontab < /opt/test-config/aaicrontab -- 2.16.6