Skip to content

List incomplete snapshots and allow deleting them - #598

Open
martin152 wants to merge 1 commit into
linuxmint:masterfrom
martin152:show-incomplete-snapshots
Open

martin152 wants to merge 1 commit into
linuxmint:masterfrom
martin152:show-incomplete-snapshots

Conversation

@martin152

Copy link
Copy Markdown

Ref #554.

After a cancelled or failed snapshot the folder stays in snapshots/ without an info.json.
Nothing shows it. --list doesn't, the window doesn't, and
timeshift --delete --snapshot <name> says "Could not find snapshot", since these folders end up
in SnapshotRepo.invalid_snapshots and the listing and the lookup only read snapshots. Only the
next scheduled check removes it, silently.

I'd rather keep such a folder than lose it, since a partial copy can still be useful after a
failed run. It just has to be manageable. So they're now listed after the other snapshots. In the
window the start time comes from the folder name and the description reads "Incomplete, cannot be
restored"; on the command line they're printed below the table. They can be browsed and deleted
from the window or with --delete --snapshot. Restoring one is refused.

Tested with a copy of a snapshot without its info.json. Master's --list doesn't show it and
--delete --snapshot 2026-11-24_00-00-00 answers E: Could not find snapshot. With this branch:

Num     Name                 Tags  Description
------------------------------------------------------------------------------
0    >  2026-11-24_00-29-00  O

Incomplete snapshots (can be deleted with --delete, not restored):
  2026-11-24_00-00-00

and the delete removes it. In the window it shows as its own row with that description.

A snapshot that was cancelled or failed stays in snapshots/ without an
info.json. It was shown nowhere: not by --list, not in the window, and
--delete --snapshot answered "Could not find snapshot", because
these folders are kept in SnapshotRepo.invalid_snapshots while the
listing and the lookup only read snapshots. Only the next scheduled
check removed it, silently.

Such snapshots are now listed after the others, in the window with
the start time taken from the folder name and the description
"Incomplete, cannot be restored", and on the command line below the
table. They can be browsed and deleted, from the window or with
--delete --snapshot. Restoring one is refused.

Ref linuxmint#554.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant