Search by

componist / backup

Componist

CLI and scheduled MySQL database backups for Laravel with PDO dump, ZIP archives, rotation, and optional email notify

dev-main / 1.0.x-dev 2026-09-17 10:55 UTC

This package is auto-updated.

Last update: 2026-09-17 11:24:05 UTC


README

Laravel-Package für den CLI-/Scheduler-Auto-Dump von MySQL: Artisan-Command, optionaler Queue-Job, ZIP-Archiv und Rotation alter Backups. Ergänzt das Dashboard-Package reinholdjesse/backup (UI + Admin-Gate).

Installation

Im Monorepo bereits registriert (Componist\Backup\BackupServiceProvider).

php artisan vendor:publish --tag=componist.backup

Konfiguration

Config-Key: componist_backup (config/componist_backup.php).

Key / .env Beschreibung
path Backup-Verzeichnis (Standard: storage/backups)
max_backups Anzahl behaltener ZIP-Dateien (Standard: 7)
DB_* MySQL-Zugangsdaten (Fallback: database.connections.mysql)
BACKUP_NOTIFY_EMAIL E-Mail bei Erfolg/Fehler
BACKUP_DAILY_AT Scheduler-Zeit (Standard: 01:00)

Nutzung

# In Queue stellen (Standard)
php artisan componist:db-backup

# Synchron ausführen (Cron ohne Worker)
php artisan componist:db-backup --sync

Der Package-Scheduler führt täglich componist:db-backup --sync zur konfigurierten Zeit aus.

Commands

Command Beschreibung
php artisan componist:db-backup Dump starten (Queue-Job)
php artisan componist:db-backup --sync Dump synchron ausführen

Berechtigungen

Kein HTTP-/Admin-Gate — Ausführung nur per CLI/Cron. Dashboard-Zugriff und Admin-Gate liegen in reinholdjesse/backup.

Tests

php artisan test --compact --testsuite="Componist Backup CLI"

Hinweise

  • PDO-Dump — keine Shell-Interpolation / kein mysqldump via passthru
  • Identifier-Guard — Tabellen-/Spaltennamen validiert und gequotet
  • Path-Jail — nur unter konfiguriertem Root, Dateinamen backup_YYYY-MM-DD_HH-mm-ss.zip
  • Erfolgs-Mail nur wenn BACKUP_NOTIFY_EMAIL gesetzt und gültig