Zum Hauptinhalt springen
Markdown anzeigen

Delete Snapshot

The snapshot delete command deletes a specific snapshot.

Bash
zeysdk snapshot delete <SNAPSHOT_ID>

Parameters

ParameterDescriptionRequiredExample
SNAPSHOT_IDID of snapshot to removeYes20231101-123456

Process

  1. Snapshot Lookup

    • Accepts IDs with or without the .zip suffix
    • Accepts only a safe snapshot filename and rejects directory separators or traversal
    • Verifies the resolved archive remains within .zeysdk/snapshots
    • Stops when the snapshot does not exist
  2. Deletion

    • Removes the snapshot archive
    • Removes the snapshot metadata entry
    • Reports successful removal

Examples

Bash
zeysdk snapshot delete 20231101-123456

Error Handling

ErrorDescriptionResolution
Invalid IDID is empty, contains unsafe characters, or contains a pathCopy the ID from snapshot list
Not foundSnapshot archive does not existCheck snapshot list
Access deniedPermission issueCheck file permissions

Notes

  • Delete removes the snapshot archive from local storage
  • Delete also removes the matching metadata entry
  • The archive is first renamed to a same-directory tombstone; if the atomic metadata update fails, the original archive name is restored
  • Invalid or unreadable snapshot metadata stops deletion before the archive is moved
  • Delete does not prompt for confirmation when called directly
  • Snapshot deletion cannot be undone
  • Use zeysdk snapshot list to find the exact snapshot ID

Best Practices

  • Keep snapshots that mark stable milestones
  • Remove old snapshots after they are no longer needed
  • Verify a newer snapshot exists before deleting an older known-good one
  • Avoid deleting snapshots during active rollback work