From e1c8edc956584e03f803328276bcbbb87964de99 Mon Sep 17 00:00:00 2001 From: Ward Wouts Date: Fri, 30 Jan 2009 10:58:31 +0000 Subject: [PATCH] addjob zou moeten werken --- pbatch/pb.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pbatch/pb.rb b/pbatch/pb.rb index 61ac495..bd0d73e 100755 --- a/pbatch/pb.rb +++ b/pbatch/pb.rb @@ -10,6 +10,7 @@ PROCDIR = "processors" RESULTDIR = "results" FAILDIR = "failure" MONITORDIR = "monitor" +RUNMODE = 0755 CONFIG = "config" @config = { "waittime" => 3, "maxproc" => 3 } @@ -106,11 +107,20 @@ end def addjob p ARGV.join(" ") 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 def addjobfromfile # File.copy asdfasdf + jobnumber=sprintf("%06d", increasejobscounter) end def createconfig