Skip to content
Snippets Groups Projects
backup-standalone.j2 589 B
Newer Older
nd's avatar
nd committed
#!/bin/bash
set -euo pipefail

test -f "/etc/backup-client/enabled" || { echo "Standalone backup is disabled"; exit 0; }

{% if backup_backend == 'restic' %}
# restic backend
source /etc/backup-client/restic.env

restic backup \
nd's avatar
nd committed
	--cleanup-cache {% if not backup_restic_cache %} --no-cache{% endif %} \
nd's avatar
nd committed
	--verbose \
	--exclude-caches \
	--one-file-system \
	--exclude "${RESTIC_REPOSITORY}" \
	--exclude-file "/etc/backup-client/exclude_files" \
	--files-from "/etc/backup-client/include_files"


{% endif %}
{% if not backup_backend %}
echo "Noop, backup is handled external"
{% endif %}