docs: Add 16, update 2 and remove 2 files
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 9s
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 9s
This commit is contained in:
21
graylog/backup.sh
Executable file
21
graylog/backup.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC1091
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "${SCRIPT_DIR}/_volumes.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME"
|
||||
|
||||
# BACKUP SCRIPT
|
||||
# Creates a backup of all Graylog data volumes
|
||||
|
||||
# Stop containers before backup
|
||||
docker compose -p "${CONTAINER_NAME}" stop || _die "Failed to stop Graylog stack"
|
||||
|
||||
# Backup all volumes
|
||||
# shellcheck disable=SC2046
|
||||
backup_items $(get_graylog_volumes) || _die "Failed to create backup"
|
||||
|
||||
# Restart containers
|
||||
docker compose -p "${CONTAINER_NAME}" start || _die "Failed to restart Graylog stack"
|
||||
|
||||
echo "Backup created successfully"
|
||||
Reference in New Issue
Block a user