addjob zou moeten werken

This commit is contained in:
Ward Wouts 2009-01-30 10:58:31 +00:00
parent 8b8a8c560c
commit e1c8edc956

View file

@ -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