Skip to content

Commit

Permalink
add elasticsearch-backup to target
Browse files Browse the repository at this point in the history
  • Loading branch information
rhanka committed Jan 10, 2020
1 parent 256410c commit 7ae83e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ kibana
log
projects
artifacts
backup

9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@ export POSTGRES_PASSWORD=matchid
export CRED_TEMPLATE=./creds.yml
export CRED_FILE=conf/security/creds.yml

# backup dir
export BACKUP_DIR=${BACKEND}/backup

# elasticsearch defaut configuration
export ES_NODES = 3 # elasticsearch number of nodes
export ES_SWARM_NODE_NUMBER = 2 # elasticsearch number of nodes
export ES_MEM = 1024m # elasticsearch : memory of each node
export ES_VERSION = 7.5.0
export ES_DATA = ${BACKEND}/esdata
export ES_BACKUP_FILE := $(shell echo esdata_`date +"%Y%m%d"`.tar)

dummy := $(shell touch artifacts)
include ./artifacts
Expand Down Expand Up @@ -122,7 +126,12 @@ endif
elasticsearch2-stop:
@${DC} -f ${DC_FILE}-elasticsearch-huge-remote.yml down

elasticsearch-backup: elasticsearch-stop backup-dir
@echo taring ${ES_DATA} to ${BACKUP_DIR}/${ES_BACKUP_FILE}
@tar cf ${BACKUP_DIR}/${ES_BACKUP_FILE} $$(basename ${ES_DATA}) -C $$(dirname ${ES_DATA})

backup-dir:
@if [ ! -d "$(BACKUP_DIR)" ] ; then mkdir -p $(BACKUP_DIR) ; fi

vm_max:
ifeq ("$(vm_max_count)", "")
Expand Down

0 comments on commit 7ae83e1

Please sign in to comment.