Skip to content

Enhancement: CLI command to cancel a running backup #2491

@guttermonk

Description

@guttermonk

The problem

Currently there is no automated way to pause or cancel a backup before hibernating my laptop.

Add a CLI command (or signal-based mechanism) to cancel a backup that is currently in progress — equivalent to pressing the Cancel button in the GUI.

Motivation

There is currently no way to cancel an active Vorta backup from the command line. vorta --create can initiate a backup, but there are no flags to interrupt or cancel a running one.

This makes it difficult to integrate Vorta cleanly into system automation. A concrete example is pre-hibernate hooks: before a system hibernates it is desirable to stop any in-progress backup gracefully (so borg can write a checkpoint and leave the repository in a consistent state), then let the next scheduled backup run pick up where it left off via borg's deduplication.

Without a CLI cancel command, the only options are:

  • Send SIGTERM directly to the .borg-wrapped child process — borg checkpoints and exits, but Vorta sees its child die unexpectedly and may log it as an error/failure rather than a clean cancellation
  • Send SIGTERM to the .vorta-wrapped process — kills the entire application, which is much more disruptive than a cancel

Neither option replicates what the GUI cancel button does (terminate borg gracefully, keep Vorta alive, mark the job as cancelled).

Requested Solution

A CLI flag such as:

vorta --cancel

That cancels the currently running backup job (if any) and exits, leaving the Vorta daemon running. Internally this would call the same code path as the GUI cancel button (process.terminate() on the borg subprocess).

Alternatively, a dedicated IPC signal or D-Bus message would also work if a CLI flag is not suitable for the architecture.

Expected behaviour
  • If a backup is in progress: borg is terminated gracefully (checkpoint written), Vorta marks the job as cancelled, Vorta continues running
  • If no backup is in progress: exits cleanly with a 0 return code (or a documented non-zero code)

Alternatives

Current workaround

pkill -SIGTERM -f '\.borg-wrapped'

This stops borg with a checkpoint but Vorta treats it as an unexpected failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions