feat: add BackupCard component and corresponding Backup model to enhance settings functionality and data management

This commit is contained in:
Julien Froidefond
2025-11-30 07:50:47 +01:00
parent f17b83fb95
commit 7cb1d5f433
15 changed files with 1102 additions and 1 deletions

31
scripts/run-backup.ts Normal file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env tsx
/**
* Script to run automatic backups
* Can be executed via cron job or scheduled task
* Usage: tsx scripts/run-backup.ts
*/
import { backupService } from "../services/backup.service";
async function main() {
try {
console.log("Checking if automatic backup should run...");
const shouldRun = await backupService.shouldRunAutomaticBackup();
if (!shouldRun) {
console.log("Backup not due yet. Skipping.");
process.exit(0);
}
console.log("Creating automatic backup...");
const backup = await backupService.createBackup();
console.log(`Backup created successfully: ${backup.filename} (${backup.size} bytes)`);
process.exit(0);
} catch (error) {
console.error("Error running automatic backup:", error);
process.exit(1);
}
}
main();