Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

79 lines (62 sloc) 2.12 KB
JOb Queue
niko 2010-2012
as its name seems to indicate, joq manage a jobs queue!
this queue can run a parametizabled number of jobs simultaneously.
a job can be shell code or perl code/class, and have many parameters such as when to start (at a time, after a time, after other jobs, etc...), log, priority, and nice.
there's more than one way to supervise joq : telnet, command line tool joq-client, or programatically with perl and joq::client.
bin/joq --help #show options
bin/joq --demo #show a short demo
bin/joq #start a foreground joq with default options
by default joq can start
config file are in json or yaml.
sample config file :
"polling": 2,
"server": "off",
"oneshot": 0,
"log": {
"level": "NOTICE",
"file": "/var/log/joq.log",
"console": "color"
"jobs": [
{ "name":"foo", "shell":"ls", "args":"/", "when": { "delay":0 } },
{ "code":"for(qw/un deux trois quatre cinq/){ print "$_\n"; sleep 1 }" },
{ "shell":"echo 'bar'", "when": {"after":"foo"} }
jobs must have at least a class, code, or shell parameter.
name = "jobname" (default=first word of class/code/shell)
shell = cmd
nice = int -20(fast) > 19(slow)
class = perl class::name with ->new and ->run([args]) methods
package = perl class::name to use
args = array of arguments given to the class
code = perl_code_to_eval
priority = 1-10 (1=slow,10=speed,default=5)
logfile = filename for job log output
timeout = duration* (default=unlimited)
when = {
dayofweek: "all|sat,mon,1-7" 1=monday, time:"hh:mm,hh:mm,.."
dayofmonth: "all|1-31,...", time:"hh:mm,hh:mm,..."
dayofyear: "all|1-365,...", time:"hh:mm,hh:mm,..."
repeat: duration*
after: "job1 or job2 and job3"
start: "yyyy-mm-dd hh:mm"
if: perl_code_to_eval as start condition
delay: duration*
count: nbtime
} default={ count:1 }
*duration can be expressed as 12 / 12s / 2m / 5h
#with a command line
bin/joq-client status
bin/joq-client list
bin/joq-client show jobname
#with telnet
telnet localhost 1970
Jump to Line
Something went wrong with that request. Please try again.