jobber examples: out-of-order processing
It is possible to executes tasks "out-of-order", i.e. to deviate from sequential processing of the task queue.
- With the
execaction arbitrary tasks from the task list can be executed. - With the
holdaction execution of specific tasks can be prevented. The hold status can be ended with thereleaseaction.
- The format of the
exec,holdandreleaseactions isaction[:spec], wherespeccan beall(with is default) or a comma separated list of ranges (see below). - Action
print:heldis used to show the effects ofholdandrelease. Actionprint[:spec]prints tasks from the task queue that match thespeccriterion as a shell script.speccan beall(with is default) or one out ofqueued,running,done,failed,held.
exec
shell$cat task.listsleep 1; echo '### this is task 1 ###' sleep 1; echo '### this is task 2 ###' sleep 1; echo '### this is task 3 ###' sleep 1; echo '### this is task 4 ###' sleep 1; echo '### this is task 5 ###' sleep 1; echo '### this is task 6 ###' sleep 1; echo '### this is task 7 ###' sleep 1; echo '### this is task 8 ###' sleep 1; echo '### this is task 9 ###' sleep 1; echo '### this is task 10 ###' shell$jobber task.list init[2022-04-05T17:39:38] appended 10 tasks shell$jobber task.list 3[2022-04-05T17:39:38] 1.1 task.worker: sleep 1; echo '### this is task 1 ###' ### this is task 1 ### [2022-04-05T17:39:39] 1.1 exit status: 0 [2022-04-05T17:39:39] 2.2 task.worker: sleep 1; echo '### this is task 2 ###' ### this is task 2 ### [2022-04-05T17:39:40] 2.2 exit status: 0 [2022-04-05T17:39:40] 3.3 task.worker: sleep 1; echo '### this is task 3 ###' ### this is task 3 ### [2022-04-05T17:39:41] 3.3 exit status: 0 shell$jobber task.list exec:5,7-8[2022-04-05T17:39:41] 5.4 task.worker: sleep 1; echo '### this is task 5 ###' ### this is task 5 ### [2022-04-05T17:39:42] 5.4 exit status: 0 [2022-04-05T17:39:42] 7.5 task.worker: sleep 1; echo '### this is task 7 ###' ### this is task 7 ### [2022-04-05T17:39:43] 7.5 exit status: 0 [2022-04-05T17:39:43] 8.6 task.worker: sleep 1; echo '### this is task 8 ###' ### this is task 8 ### [2022-04-05T17:39:44] 8.6 exit status: 0 shell$jobber task.list 3[2022-04-05T17:39:44] 4.7 task.worker: sleep 1; echo '### this is task 4 ###' ### this is task 4 ### [2022-04-05T17:39:45] 4.7 exit status: 0 [2022-04-05T17:39:45] 6.8 task.worker: sleep 1; echo '### this is task 6 ###' ### this is task 6 ### [2022-04-05T17:39:46] 6.8 exit status: 0 [2022-04-05T17:39:46] 9.9 task.worker: sleep 1; echo '### this is task 9 ###' ### this is task 9 ### [2022-04-05T17:39:47] 9.9 exit status: 0 shell$
hold/release
shell$cat task.listsleep 1; echo '### this is task 1 ###' sleep 1; echo '### this is task 2 ###' sleep 1; echo '### this is task 3 ###' sleep 1; echo '### this is task 4 ###' sleep 1; echo '### this is task 5 ###' sleep 1; echo '### this is task 6 ###' sleep 1; echo '### this is task 7 ###' sleep 1; echo '### this is task 8 ###' sleep 1; echo '### this is task 9 ###' sleep 1; echo '### this is task 10 ###' shell$jobber task.list init[2022-04-05T17:40:09] appended 10 tasks shell$jobber task.list 3[2022-04-05T17:40:09] 1.1 task.worker: sleep 1; echo '### this is task 1 ###' ### this is task 1 ### [2022-04-05T17:40:10] 1.1 exit status: 0 [2022-04-05T17:40:10] 2.2 task.worker: sleep 1; echo '### this is task 2 ###' ### this is task 2 ### [2022-04-05T17:40:11] 2.2 exit status: 0 [2022-04-05T17:40:11] 3.3 task.worker: sleep 1; echo '### this is task 3 ###' ### this is task 3 ### [2022-04-05T17:40:12] 3.3 exit status: 0 shell$jobber task.list print:held#!/bin/bash shell$jobber task.list hold:4-5,7-8[2022-04-05T17:40:12] tasks changed to state H: 4 shell$jobber task.list print:held#!/bin/bash # task 4 worker held sleep 1; echo '### this is task 4 ###' # task 5 worker held sleep 1; echo '### this is task 5 ###' # task 7 worker held sleep 1; echo '### this is task 7 ###' # task 8 worker held sleep 1; echo '### this is task 8 ###' shell$jobber task.list release:4[2022-04-05T17:40:13] tasks changed to state Q: 1 shell$jobber task.list print:held#!/bin/bash # task 5 worker held sleep 1; echo '### this is task 5 ###' # task 7 worker held sleep 1; echo '### this is task 7 ###' # task 8 worker held sleep 1; echo '### this is task 8 ###' shell$jobber task.list 3[2022-04-05T17:40:13] 4.4 task.worker: sleep 1; echo '### this is task 4 ###' ### this is task 4 ### [2022-04-05T17:40:14] 4.4 exit status: 0 [2022-04-05T17:40:14] 6.5 task.worker: sleep 1; echo '### this is task 6 ###' ### this is task 6 ### [2022-04-05T17:40:15] 6.5 exit status: 0 [2022-04-05T17:40:15] 9.6 task.worker: sleep 1; echo '### this is task 9 ###' ### this is task 9 ### [2022-04-05T17:40:16] 9.6 exit status: 0 shell$