Skip to content

Show the progress of a scheduled snapshot instead of refusing to open - #596

Open
martin152 wants to merge 2 commits into
linuxmint:masterfrom
martin152:show-running-task
Open

martin152 wants to merge 2 commits into
linuxmint:masterfrom
martin152:show-running-task

Conversation

@martin152

Copy link
Copy Markdown

Builds on #595, whose commit is included here. Only the last commit is new.

If I open Timeshift while the hourly check is creating a snapshot, I get "Another instance of
Timeshift is creating a snapshot. Please wait a few minutes and try again." and that's it. A
scheduled snapshot can take over an hour here, and there's no way to see where it is.

Now the window follows the other process through the status file from #595. It shows what it's
doing, a progress bar and the time remaining, and once that process ends it carries on and opens
Timeshift as usual. Closing it doesn't touch the snapshot. With two windows (lock mode "") the
old message stays.

On a scratch disk image, opening the window during a 1 GB snapshot logged
Waiting for running instance (PID=2538732, mode=ondemand), then Running instance has finished,
and the main window came up as usual. On my real system, opened while a snapshot was running,
it read "Creating snapshot 2026-11-24_00-35-44", 3 %, "00:11:26 remaining".

…snapshot

While a snapshot is created, checked for space, deleted or restored,
the running instance now writes what it is doing to
/var/run/lock/timeshift/status next to the lock: pid, mode, action,
snapshot name, progress, seconds remaining and the counts. The file is
readable by every user and is removed with the lock, so a panel applet
or a second window can show the same progress the window shows today.
A scheduled run's progress was only printed to a stdout nobody reads.

The total for that progress was the file count saved when Timeshift
was set up (Main.first_snapshot_count). On a system that has grown
since, the bar passes 100 % long before the end (linuxmint#461). Copies now
count against the snapshot they link from, and deletes against the
snapshot being deleted, as restores already did; the saved figure is
only used when there is no snapshot yet.
… to open

When the hourly check was creating a snapshot, opening Timeshift only
showed "Another instance of Timeshift is creating a snapshot. Please
wait a few minutes and try again." and exited, so the progress of a
scheduled snapshot could not be followed anywhere.

The window now follows that process through the status file it
publishes, showing what it is doing, the progress and the time
remaining, and goes on to open Timeshift as usual when the process
ends. Closing it leaves the snapshot running. With a second window
(lock mode "") the old message is kept.
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