All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 9s
22 lines
652 B
Bash
Executable File
22 lines
652 B
Bash
Executable File
#!/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"
|