mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-16 11:25:24 +02:00
feat(backups): improve backup retention across different database types
- Add serverId parameter to keepLatestNBackups function - Execute backup retention commands on the specific server for each database type - Remove global backup retention call in favor of per-database type retention
This commit is contained in:
@@ -13,15 +13,17 @@ export const scheduleBackup = (backup: BackupSchedule) => {
|
||||
scheduleJob(backupId, schedule, async () => {
|
||||
if (databaseType === "postgres" && postgres) {
|
||||
await runPostgresBackup(postgres, backup);
|
||||
await keepLatestNBackups(backup, postgres.serverId);
|
||||
} else if (databaseType === "mysql" && mysql) {
|
||||
await runMySqlBackup(mysql, backup);
|
||||
await keepLatestNBackups(backup, mysql.serverId);
|
||||
} else if (databaseType === "mongo" && mongo) {
|
||||
await runMongoBackup(mongo, backup);
|
||||
await keepLatestNBackups(backup, mongo.serverId);
|
||||
} else if (databaseType === "mariadb" && mariadb) {
|
||||
await runMariadbBackup(mariadb, backup);
|
||||
await keepLatestNBackups(backup, mariadb.serverId);
|
||||
}
|
||||
|
||||
await keepLatestNBackups(backup);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user