feat: automatische geplante Backups mit Rotation
Phase 1.3 - Automatische Backups: - Cron-basierter Scheduler (Standard: täglich 2 Uhr) - Konfigurierbar über .env (Zeitplan, Verzeichnis, Anzahl) - Automatische Rotation: behält nur letzte N Backups (Standard: 7) - UI in Settings → Backup: Status-Anzeige und manueller Trigger - Tests: 7 erfolgreiche Tests für Scheduler-Funktionalität Neue Umgebungsvariablen: - BACKUP_ENABLED (Standard: true) - BACKUP_SCHEDULE (Standard: 0 2 * * *) - BACKUP_DIR (Standard: ./backups) - BACKUP_KEEP (Standard: 7) - TZ (für Zeitzone) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,7 @@ import { buildOpenApiSpec } from './openapi.js';
|
||||
import * as googleCalendar from './services/google-calendar.js';
|
||||
import * as appleCalendar from './services/apple-calendar.js';
|
||||
import * as icsSubscription from './services/ics-subscription.js';
|
||||
import { startScheduler as startBackupScheduler } from './services/backup-scheduler.js';
|
||||
import dashboardRouter from './routes/dashboard.js';
|
||||
import tasksRouter from './routes/tasks.js';
|
||||
import shoppingRouter from './routes/shopping.js';
|
||||
@@ -274,6 +275,9 @@ app.listen(PORT, () => {
|
||||
setInterval(runSync, SYNC_INTERVAL_MS);
|
||||
logSync.info(`Auto-sync active every ${SYNC_INTERVAL_MS / 60_000} minutes.`);
|
||||
}, 10_000);
|
||||
|
||||
// Backup-Scheduler starten
|
||||
startBackupScheduler();
|
||||
});
|
||||
|
||||
export default app;
|
||||
|
||||
Reference in New Issue
Block a user