LinuxCommandLibrary

pueue-remove

Remove tasks from the pueue queue

TLDR

Remove a killed or finished task

$ pueue remove [task_id]
copy

Remove multiple tasks at once
$ pueue remove [task_id] [task_id]
copy

SYNOPSIS

pueue remove [OPTIONS] [TASK_IDS_OR_TAGS...]

PARAMETERS

TASK_IDS_OR_TAGS...
    Optional. One or more task IDs (numeric) or tags (alphanumeric) to remove. If omitted, the last added task (if not started) is removed.

-a, --all
    Remove all tasks currently in the queue, regardless of their state or group.

-g, --group <GROUP>
    Remove all tasks belonging to the specified group.

-c, --confirm
    Explicitly ask for confirmation when performing potentially dangerous operations, such as removing all tasks. This is often the default behavior for such operations.

-f, --force
    Suppress the confirmation prompt for potentially dangerous operations, allowing for immediate removal without user interaction. This option overrides --confirm.

DESCRIPTION

pueue-remove is a subcommand of the pueue task management system, designed for efficiently removing tasks from its queue. Pueue is a command-line tool and library for managing a queue of shell commands, allowing users to schedule, run, and oversee tasks in the background.

The remove command specifically targets tasks by their unique IDs or assigned tags. If invoked without any specific task IDs or tags, it defaults to removing the most recently added task, provided it hasn't already started execution. This command is crucial for cleaning up the queue, canceling scheduled operations, or re-organizing pending work. It supports various options for bulk removal, such as clearing all tasks or targeting specific task groups, and includes safeguards against accidental deletions.

CAVEATS

Removed tasks are permanently deleted from the queue and cannot be recovered.

If a task is currently running when pueue remove is called on it, Pueue will typically mark it for removal upon completion rather than immediately terminating it, unless specifically configured otherwise.

Using --all or -g with a group name can lead to mass deletions. Always double-check the command before executing, especially in production or critical environments. The --force option bypasses the confirmation prompt, increasing the risk of accidental data loss.

DAEMON-CLIENT ARCHITECTURE

Pueue operates with a client-server model. The pueue remove command acts as a client that communicates with the long-running Pueue daemon to request task removal. The daemon then handles the actual queue manipulation.

TASK IDS AND TAGS

Tasks in Pueue are identified by unique numeric IDs assigned sequentially, and can also be assigned custom string tags for easier grouping and manipulation. Both can be used with pueue remove.

HISTORY

pueue is a relatively modern and actively developed command-line tool, first appearing around 2017-2018. It was created to provide a more flexible and robust alternative to simple `&` or `nohup` for background tasks, offering features like task grouping, dependency management, and persistent queues. The pueue remove command has been a core component since its early versions, providing essential queue management capabilities as the project evolved. Its development focuses on a user-friendly CLI with a reliable backend written in Rust.

SEE ALSO

Copied to clipboard