#1 Calibre-web backup script

This commit is contained in:
Tibo De Peuter 2023-06-15 20:56:48 +02:00
parent 67e89ea2d1
commit b9bf1840c4

View file

@ -0,0 +1,17 @@
#!/bin/bash
# Backup script for Calibre-web in a kubernetes cluster
BACKUP_DEST="/mnt/PRIVATE_DOCS/BACKUPS/calibre-web"
# Retrieve container name
base_container=$( docker ps --format "{{.Names}}" | grep tkioskje-calibre-web_tkioskje-calibre-web )
# Abort entire script if any command fails
set -e
# Database backup
>&2 echo "Backing up database"
database_file="/app/calibre-web/app.db"
docker cp "${base_container}":"${database_file}" "${BACKUP_DEST}"
>&2 echo "Done"