2 # Batch EXecutor -- Operations on a Job
3 # (c) 2011-2015 Martin Mares <mj@ucw.cz>
16 Usage: bex job [<options>] [<job-id>]
18 If a job-id is given, print information on the given job.
19 Otherwise, list all known jobs.
22 -e, --edit Run editor on the given job (no locking)
23 -l, --long When listing jobs, use long format (with subjects)
24 -q, --queue=<name> Act on the given queue
32 "q|queue=s" => \$queue_name,
34 ) && @ARGV <= 1 or die "Try `bex job --help' for more information.\n";
36 my $queue = BEX::Queue->new($queue_name);
39 my @jobs = $queue->all_job_ids;
40 for my $id (sort @jobs) {
42 my $job = $queue->job_metadata($id);
43 my $has_att = -d $queue->attachment_dir($id);
45 print " +ATT" if $has_att;
54 my $jid = $queue->resolve_job_id($ARGV[0]);
55 my $fn = $queue->job_file($jid);