updated script for restore 61/6361/1
authorvt402f <vt00325492@techmahindra.com>
Tue, 28 Jan 2020 02:22:01 +0000 (21:22 -0500)
committervt402f <vt00325492@techmahindra.com>
Tue, 28 Jan 2020 02:22:21 +0000 (21:22 -0500)
Change-Id: I3c9b4773bfff535d8a207af495328e32b324a828
Signed-off-by: vt402f <vt00325492@techmahindra.com>
elk-client/script/archive_script.sh
elk-client/src/main/java/org/acumos/elk/client/service/SnapshotRepositoryServiceImpl.java

index ea56984..ed9e780 100644 (file)
@@ -97,6 +97,7 @@ log INFO "Inside restore_esdata:"
             chown '1000:1000' ../../elasticsearch/data/backup/$repo
             log INFO "Restore done:$(date +%Y-%m-%d:%H:%M:%SZ),$repo"
             echo "$(date +%Y-%m-%d:%H:%M:%SZ),$repo"
+            rm -rf $directory_name/$repo
         else
             log ERROR "$repo:Repository not found | No data available to restore"
             echo "No data present to restore"
index 04f0a66..3d9f985 100644 (file)
@@ -290,7 +290,7 @@ public class SnapshotRepositoryServiceImpl extends AbstractELKClientConnection i
                        elkArchiveResponse.setStatus(ElkClientConstants.SUCCESS);
                        elkArchiveResponse.setArchiveInfo(archiveInfoList);
                        logger.debug("archiveInfoList:{} action:{}", archiveInfoList, action);
-                       /*if (action.equalsIgnoreCase(ElkClientConstants.RESTORE_REQUEST)) {
+                       if (action.equalsIgnoreCase(ElkClientConstants.RESTORE_REQUEST)) {
                                for (ArchiveInfo archiveInfo : archiveInfoList) {
                                        ElkRepositoriesRequest elkCreateRepositoriesRequest = new ElkRepositoriesRequest();
                                        elkCreateRepositoriesRequest.setRepositoryName(archiveInfo.getRepositoryName());
@@ -299,7 +299,7 @@ public class SnapshotRepositoryServiceImpl extends AbstractELKClientConnection i
                                        logger.debug("elkCreateRepositoriesRequest:{}  action:{}", elkCreateRepositoriesRequest.getRepositoryName(), action);
                                        createElkRepository(elkCreateRepositoriesRequest, action);
                                }
-                       }*/
+                       }
                        logger.debug("completed for loop of restore:{}" + archiveInfoList);
                } else {
                        logger.debug("result:" + result);