#!/bin/bash
source "${AGENT_PATH}/_common.sh"
_check_required_env_vars "CONTAINER_NAME" "LOCAL_DATA_FOLDER"

# Stop container before backup
_stop_container "$CONTAINER_NAME"

autobackup "path=${LOCAL_DATA_FOLDER}" $1 $2 || _die "Failed to create backup"

# Start container after backup
_start_container "$CONTAINER_NAME"

echo "Backup created successfully"
