addjob zou moeten werken
This commit is contained in:
parent
8b8a8c560c
commit
e1c8edc956
1 changed files with 11 additions and 1 deletions
12
pbatch/pb.rb
12
pbatch/pb.rb
|
|
@ -10,6 +10,7 @@ PROCDIR = "processors"
|
||||||
RESULTDIR = "results"
|
RESULTDIR = "results"
|
||||||
FAILDIR = "failure"
|
FAILDIR = "failure"
|
||||||
MONITORDIR = "monitor"
|
MONITORDIR = "monitor"
|
||||||
|
RUNMODE = 0755
|
||||||
CONFIG = "config"
|
CONFIG = "config"
|
||||||
@config = { "waittime" => 3, "maxproc" => 3 }
|
@config = { "waittime" => 3, "maxproc" => 3 }
|
||||||
|
|
||||||
|
|
@ -106,11 +107,20 @@ end
|
||||||
def addjob
|
def addjob
|
||||||
p ARGV.join(" ")
|
p ARGV.join(" ")
|
||||||
jobnumber=sprintf("%06d", increasejobscounter)
|
jobnumber=sprintf("%06d", increasejobscounter)
|
||||||
p jobnumber
|
puts "New job: #{jobnumber}"
|
||||||
|
if FileTest.exists?("#{@basedir}/#{JOBSDIR}/#{jobnumber}")
|
||||||
|
puts "Job #{jobnumber} already scheduled. This should not happen."
|
||||||
|
exit
|
||||||
|
end
|
||||||
|
File.open("#{@basedir}/#{JOBSDIR}/#{jobnumber}"){|file|
|
||||||
|
file.puts ARGV.join(" ")
|
||||||
|
}
|
||||||
|
File.chmod(RUNMODE, "#{@basedir}/#{JOBSDIR}/#{jobnumber}")
|
||||||
end
|
end
|
||||||
|
|
||||||
def addjobfromfile
|
def addjobfromfile
|
||||||
# File.copy asdfasdf
|
# File.copy asdfasdf
|
||||||
|
jobnumber=sprintf("%06d", increasejobscounter)
|
||||||
end
|
end
|
||||||
|
|
||||||
def createconfig
|
def createconfig
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue