#!/usr/bin/env sh # Back up Quorla's live data (logins, library uploads, queue, client files, reports, branding, .env). # Run from the project folder: sh deploy/backup.sh → backups/quorla-YYYY-MM-DD-HHMM.tar.gz # Keeps the newest 14 backups. Schedule daily with cron (see docs/hosting.html, "Backups"). set -eu cd "$(dirname "$0")/.." mkdir -p backups name="backups/quorla-$(date +%Y-%m-%d-%H%M).tar.gz" tar -czf "$name" --exclude='data/**/*.lock' .env data clients team reports branding chmod 600 "$name" ls -1t backups/quorla-*.tar.gz | tail -n +15 | xargs -r rm -f echo "Backup written: $name ($(du -h "$name" | cut -f1))"