it's all in the details
This commit is contained in:
parent
84776cb511
commit
3088d578f5
1 changed files with 19 additions and 17 deletions
|
|
@ -39,6 +39,7 @@ ENDTXT
|
|||
end
|
||||
|
||||
def readconfig
|
||||
if FileTest.exists?("#{@basedir}/#{CONFIG}")
|
||||
File.open("#{@basedir}/#{CONFIG}").each_line {|line|
|
||||
line.sub!(/#.*/, "")
|
||||
line.sub!(/^\s*/, "")
|
||||
|
|
@ -53,6 +54,7 @@ def readconfig
|
|||
else puts "unknown option #{$1}"
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def status
|
||||
|
|
@ -111,7 +113,7 @@ def addjob
|
|||
puts "Job #{jobnumber} already scheduled. This should not happen."
|
||||
exit
|
||||
end
|
||||
File.open("#{@basedir}/#{JOBSDIR}/#{jobnumber}"){|file|
|
||||
File.open("#{@basedir}/#{JOBSDIR}/#{jobnumber}", "w"){|file|
|
||||
file.puts ARGV.join(" ")
|
||||
}
|
||||
File.chmod(RUNMODE, "#{@basedir}/#{JOBSDIR}/#{jobnumber}")
|
||||
|
|
@ -136,7 +138,7 @@ end
|
|||
|
||||
def createconfig
|
||||
if ! FileTest.exists?("#{@basedir}/#{CONFIG}")
|
||||
File.new("#{@basedir}/#{CONFIG}", "w"){|file|
|
||||
File.open("#{@basedir}/#{CONFIG}", "w"){|file|
|
||||
file.puts <<EOT
|
||||
# how many parallel processes?
|
||||
maxproc=3
|
||||
|
|
@ -149,7 +151,7 @@ end
|
|||
|
||||
def master
|
||||
# als ik threading ga gebruiken is deze dus niet nodig
|
||||
File.new(RUNNINGFILE, "w").flock(File::LOCK_EX){|file|
|
||||
File.open(RUNNINGFILE, "w").flock(File::LOCK_EX){|file|
|
||||
file.puts "0"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue