All Projects → UnicastInc → elasticsearch-shell-backup

UnicastInc / elasticsearch-shell-backup

Licence: other
Elasticsearch 2, 5 shell script backup utils.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to elasticsearch-shell-backup

kube-dump
Backup a Kubernetes cluster as a yaml manifest
Stars: ✭ 142 (+688.89%)
Mutual labels:  backup, backup-script
pgsql-backup
PostgreSQL Backup Script. Ported from AutoMySQLBackup.
Stars: ✭ 24 (+33.33%)
Mutual labels:  backup, backup-script
s3-mongo-backup
Mongodb backups to S3
Stars: ✭ 18 (+0%)
Mutual labels:  backup, backup-script
butdr
Backup to Cloud( Google Drive, Dropbox ... ) use rclone
Stars: ✭ 49 (+172.22%)
Mutual labels:  backup, backup-script
linux-android-backup
Back up your device without vendor lock-ins, using insecure software or root. Supports encryption and compression out of the box. Works cross-platform.
Stars: ✭ 119 (+561.11%)
Mutual labels:  backup, backup-script
gitlab-mattermost-backup
A simple backup script for mattermost in gitlab omnibus package
Stars: ✭ 23 (+27.78%)
Mutual labels:  backup, backup-script
VestaCP-Sync-Backups-To-Mega
VestaCP: uploading backups to the MEGA cloud
Stars: ✭ 17 (-5.56%)
Mutual labels:  backup, backup-script
virtnbdbackup
Backup utiliy for Libvirt / qemu / kvm supporting incremental and differencial backups.
Stars: ✭ 62 (+244.44%)
Mutual labels:  backup, backup-script
mmd-gitlab-backuper
a package to backup from all projects that you have on gitlab
Stars: ✭ 27 (+50%)
Mutual labels:  backup, backup-script
time-travel
An rsync based backup script which only transfers modified files. Smooth integration into OSX Notification Center.
Stars: ✭ 43 (+138.89%)
Mutual labels:  backup, backup-script
MailcowBackup
Script to backup/restore Mailcow and the host system using borgbackup. Handles 503 error page generation, mailflow stop/restart, SQL database dump, borg backup and prune and integrates with Logwatch for easy monitoring.
Stars: ✭ 28 (+55.56%)
Mutual labels:  backup, backup-script
raptor
The definitive EasyEngine installer with fully functional backup-restore and SFTP functionalities included
Stars: ✭ 26 (+44.44%)
Mutual labels:  backup, backup-script
auto-mysql-backup
a wrapper for automysqlbackup
Stars: ✭ 19 (+5.56%)
Mutual labels:  backup, backup-script
bash-backup
Simple backup script for GNU/Linux servers
Stars: ✭ 76 (+322.22%)
Mutual labels:  backup, backup-script
WindowsFileHistoryCleaner
Simple command line executable to turn a File History share back into a snapshot of files
Stars: ✭ 15 (-16.67%)
Mutual labels:  backup
ansible-role-borgbackup
No description or website provided.
Stars: ✭ 13 (-27.78%)
Mutual labels:  backup
BackupAssistant
Backup Assistant helps you to backup your files (like database backups or log files) to FTP Server. It works on any platform. ( Windows, Linux and Mac.)
Stars: ✭ 32 (+77.78%)
Mutual labels:  backup
authy-extractor
Extract 2FA tokens from Authy.
Stars: ✭ 30 (+66.67%)
Mutual labels:  backup
docker-vackup
Script to easily backup and restore docker volumes
Stars: ✭ 102 (+466.67%)
Mutual labels:  backup
note
just note , take down what ever i want
Stars: ✭ 62 (+244.44%)
Mutual labels:  backup

Elasticsearch Backup Shell Script

About

This scripts

Original script are provided by @karelbemelmans

Our customized script replace URL to shell variable and split file with function.

Configuration

Shell variable

edit shell-variables

  • URL: Elasticsearch base url
  • REPO: Snapshot repository name
  • LIMIT: Number of snapshots to keep

Requirements

  1. Elasticsearch 1.4, 2, 5 maybe
  2. curl
  3. jq JSON Parser command

Usage

clone scripts your preferred directory. In this case we assume cloned /etc/bacula/pre-backup.d.

git clone https://github.com/UnicastInc/elasticsearch-shell-backup.git /etc/bacula/pre-backup.d

call simply.

elasticsearch-backup-jobs.sh

This script simply execute elasticsearch-take-snapshot.sh, elasticsearch-snapshot-rotation.sh internally.

Schedule regular intervals

cron

Most easiest way to backup.

crontab

45 23 * * *    /etc/bacula/pre-backup.d/elasticsearch-backup-jobs.sh

or drop into /etc/cron.{daily,weekly,monthly} ...

Bacula

Specify in bacula-dir.conf.

Job {
  ClientRunBeforeJob = "/etc/bacula/pre-backup.d/elasticsearch-backup-jobs.sh"
}

Bacula File Daemon side, create /etc/bacula/pre-backup.d/elasticsearch-backup-jobs.sh

#!/bin/bash

# Elasticsearch snapshot lifecycle
/etc/bacula/pre-backup.d/elasticsearch-backup-jobs.sh

Another

  • Jenkins, GitLab CI or another CIs.

For Test

Take a snapshot

elasticsearch-take-snapshot.sh

Rotate snapshots

elasticsearch-snapshot-rotation.sh

Hardening Security

chmod 700 /etc/bacula/pre-backup.d
chmod 600 shell-variables

Tool commands

Get snapshot list

curl -X GET http://localhost:9200/_snapshot/es_backup/_all 2>/dev/null | jq -r '.snapshots [] .snapshot'
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].