Add manual backup trigger endpoint
POST /api/v1/system/auto-backup/trigger creates a backup on demand and returns the created file info (filename, size, timestamp). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -211,6 +211,14 @@ class AutoBackupEngine:
|
||||
raise ValueError("Invalid filename")
|
||||
return target
|
||||
|
||||
async def trigger_backup(self) -> dict:
|
||||
"""Manually trigger a backup and prune old ones. Returns the created backup info."""
|
||||
await self._perform_backup()
|
||||
self._prune_old_backups()
|
||||
# Return the most recent backup entry
|
||||
backups = self.list_backups()
|
||||
return backups[0] if backups else {}
|
||||
|
||||
def delete_backup(self, filename: str) -> None:
|
||||
target = self._safe_backup_path(filename)
|
||||
if not target.exists():
|
||||
|
||||
Reference in New Issue
Block a user