MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / delete_backup

Function delete_backup

apps/backups/services.py:355–367  ·  view source on GitHub ↗

Delete a backup file.

(filename: str)

Source from the content-addressed store, hash-verified

353
354
355def delete_backup(filename: str) -> None:
356 """Delete a backup file."""
357 backup_dir = get_backup_dir()
358 backup_file = backup_dir / filename
359
360 if not backup_file.exists():
361 raise FileNotFoundError(f"Backup file not found: {filename}")
362
363 if not backup_file.is_file():
364 raise ValueError(f"Invalid backup file: {filename}")
365
366 backup_file.unlink()
367 logger.info(f"Deleted backup: {filename}")

Callers

nothing calls this directly

Calls 2

get_backup_dirFunction · 0.85
existsMethod · 0.45

Tested by

no test coverage detected