pueue-enqueue
Add a command to the pueue queue
TLDR
Enqueue multiple stashed tasks at once
Enqueue a stashed task after 60 seconds
Enqueue a stashed task next Wednesday
Enqueue a stashed task after four months
Enqueue a stashed task on 2021-02-19
List all available date/time formats
SYNOPSIS
pueue-enqueue [OPTIONS]
PARAMETERS
-g, --group <GROUP>
Assigns the new task to a specific group. Tasks in different groups can be run independently or with different concurrency settings.
-p, --path <PATH>
Sets the working directory for the task. The command will be executed from this path.
-s, --start-immediately
Starts the task immediately upon addition, bypassing the normal queue order, if a slot is available.
-w, --wait
Blocks the command-line until the enqueued task finishes its execution.
-d, --depends-on <ID>...
Specifies one or more task IDs that this new task depends on. The task will only start once all its dependencies have successfully completed.
-l, --label <LABEL>
Assigns a custom label to the task for easier identification and management.
-C, --clear-dependencies
Removes any existing dependencies on previous tasks when re-adding an existing command.
-P, --priority <PRIORITY>
Sets the execution priority of the task. Higher priority tasks are executed before lower priority ones within the same group.
-N, --no-queue-optimization
Disables certain queue optimizations, ensuring the task is strictly added to the end of the queue.
-T, --no-shell
Executes the command directly without invoking a shell. This can be useful for commands that don't require shell features like globbing or pipes.
-B, --bulk
Reads commands from standard input, adding each line as a separate task to the queue.
-k, --key <KEY>
Assigns a unique key to the task. This can be used to prevent duplicate tasks or to manage specific tasks more easily.
-f, --force-path
Forces the creation of the working directory if it does not exist.
DESCRIPTION
pueue-enqueue is a command-line utility used to submit new tasks to the Pueue daemon's queue. Pueue is a lightweight and user-friendly task queue and job management system designed for running long-running commands, scripts, or programs in the background. It allows users to define a series of commands that will be executed sequentially or concurrently, providing features like task grouping, dependencies, priority management, and output logging.
When a command is enqueued using pueue-enqueue, it is added to a persistent queue managed by the Pueue daemon. The daemon then picks up tasks from this queue and executes them, ensuring that they run even if the user logs out. This is particularly useful for automation, managing multiple build processes, running data analysis jobs, or any task that requires background execution without tying up a terminal.
The command allows for flexible task definition, including specifying the working directory, assigning tasks to specific groups, setting execution priorities, and defining dependencies on other tasks, enabling complex workflow orchestration.
CAVEATS
Using pueue-enqueue requires the Pueue daemon to be running in the background. If the daemon is not active, the command will fail. Task output is typically redirected and can be viewed using pueue logs. Be mindful of circular dependencies when defining task dependencies, as this can lead to deadlocks. Resource management and parallel execution limits are configured via the Pueue daemon's configuration, not directly through this enqueue command.
TASK EXECUTION MODEL
When a task is enqueued, Pueue takes control of its execution. This includes managing its environment variables, working directory, and standard input/output streams. By default, standard output and standard error are captured by Pueue and can be reviewed later using commands like pueue logs. Commands are typically run within a shell (e.g., bash or sh) unless the --no-shell option is used, allowing for shell features like pipes, redirections, and command chaining.
INTEGRATION WITH SHELL
pueue-enqueue (or pueue add) is designed to be easily integrated into shell scripts and workflows. It allows for the automation of complex sequences of commands, turning a series of sequential script executions into managed background tasks. This is particularly useful in CI/CD pipelines, data processing pipelines, or personal automation scripts where reliable background execution and output capture are critical.
HISTORY
The Pueue project, started by Nsja, aims to provide a simple yet powerful command-line task queue. Historically, pueue-enqueue (or sometimes just enqueue as a subcommand) was a direct way to add tasks. In later versions of Pueue (specifically from version 1.0 onwards), the command for adding tasks was standardized under pueue add. Therefore, while pueue-enqueue might refer to older installations or specific aliases/wrappers, its functionality is directly equivalent to the modern pueue add command, which has become the primary and recommended way to enqueue tasks.
SEE ALSO
pueue(1), pueue-status(1), pueue-logs(1), pueue-start(1), pueue-stop(1), pueue-kill(1), at(1), batch(1), cron(8), nohup(1), screen(1), tmux(1)