LinuxCommandLibrary

pueue-restart

Restart the Pueue daemon process

TLDR

Restart a specific task

$ pueue restart [task_id]
copy

Restart multiple tasks at once, and start them immediately (do not enqueue)
$ pueue restart [[-k|--immediately]] [task_id] [task_id]
copy

Restart a specific task from a different path
$ pueue restart --edit-path [task_id]
copy

Edit a command before restarting
$ pueue restart [[-e|--edit]] [task_id]
copy

Restart a task in-place (without enqueuing as a separate task)
$ pueue restart [[-i|--in-place]] [task_id]
copy

Restart all failed tasks and stash them
$ pueue restart [[-a|--all-failed]] --stashed
copy

SYNOPSIS

pueue restart [TASK_IDS_OR_TAGS...] [OPTIONS]

PARAMETERS

TASK_IDS_OR_TAGS...
    One or more task IDs (integers) or tags (strings) to restart. If not specified, a status flag or --all/--group is required.

--all, -a
    Restarts all tasks currently in the queue.

--group , -g
    Restarts all tasks belonging to the specified group.

--exclude-group
    Excludes tasks belonging to the specified group from being restarted when used with --all or other group/status flags.

--failed
    Restarts all tasks that are currently in a 'failed' state.

--successful
    Restarts all tasks that have successfully completed.

--stashed
    Restarts all tasks that are currently 'stashed' (put aside for later manual execution).

--paused
    Restarts all tasks that are currently 'paused'.

--running
    Restarts all tasks that are currently 'running'. Note: This will stop and then re-queue them.

--status
    Restarts tasks with the specified status (e.g., queued, running, paused, stashed, failed, done).

--force, -f
    Skips the interactive confirmation prompt for restart operations, proceeding directly.

--exclude-id
    Excludes specific task IDs from being restarted when used with --all or --group.

DESCRIPTION

pueue-restart is a subcommand of the pueue task management utility. It allows users to re-execute tasks that have previously been added to the Pueue queue. This is particularly useful for re-running failed tasks, or simply repeating a task without re-adding it from scratch.

Tasks can be identified by their unique numerical ID or by custom tags assigned during their creation. When a task is restarted, a new task entry is created in the queue, inheriting the command and parameters of the original task. This new task is typically placed in a queued or stashed state, ready for execution by the pueued daemon. The command provides options to restart all tasks, tasks within a specific group, or specific tasks identified by their current status. It also supports non-interactive execution with a force flag, making it a powerful tool for managing background processes and ensuring task completion.

CAVEATS

Requires the pueued daemon to be running for the command to interact with the task queue.
Restarting a task creates a new task entry in the queue with the original command parameters, rather than simply resetting the status of the existing task.
Be cautious when using --all or --group combined with --force, as it can inadvertently re-execute many commands without confirmation.
Restarted tasks are typically re-added to the end of the queue by default, following existing task execution order.

TASK STATE TRANSITIONS

When pueue restart is invoked, it doesn't modify the state of the original task. Instead, it creates a new task entry in the queue, copying the command, arguments, and other parameters from the specified existing task. This new task is typically assigned a queued or stashed status, ready for execution by the daemon.

CONFIGURATION IMPACT

The behavior of pueue restart can be influenced by the user's pueue.yml configuration file. This includes default groups, execution directories, and other settings that apply to newly added tasks, thereby affecting the characteristics of the restarted task.

HISTORY

Pueue is a relatively modern, open-source project designed for simple, local task scheduling and management. It gained popularity as a lightweight alternative to more complex batch systems, especially for personal script execution and background process management. The restart functionality is a core component, reflecting the common need to easily re-run jobs, particularly those that might have failed due to transient issues or require repeated execution. Its development emphasizes user-friendliness, clear status reporting, and a robust way to manage the lifecycle of queued commands.

SEE ALSO

pueue(1), pueued(1), pueue add(1), pueue status(1), pueue stop(1), pueue pause(1), pueue start(1), pueue remove(1)

Copied to clipboard