meer ongeteste implementaties
This commit is contained in:
parent
e1c8edc956
commit
4ce585f33b
1 changed files with 14 additions and 3 deletions
17
pbatch/pb.rb
17
pbatch/pb.rb
|
|
@ -105,7 +105,6 @@ def increasejobscounter
|
||||||
end
|
end
|
||||||
|
|
||||||
def addjob
|
def addjob
|
||||||
p ARGV.join(" ")
|
|
||||||
jobnumber=sprintf("%06d", increasejobscounter)
|
jobnumber=sprintf("%06d", increasejobscounter)
|
||||||
puts "New job: #{jobnumber}"
|
puts "New job: #{jobnumber}"
|
||||||
if FileTest.exists?("#{@basedir}/#{JOBSDIR}/#{jobnumber}")
|
if FileTest.exists?("#{@basedir}/#{JOBSDIR}/#{jobnumber}")
|
||||||
|
|
@ -119,8 +118,20 @@ def addjob
|
||||||
end
|
end
|
||||||
|
|
||||||
def addjobfromfile
|
def addjobfromfile
|
||||||
# File.copy asdfasdf
|
filename = ARGV[0]
|
||||||
|
if filename.nil?
|
||||||
|
puts "Missing filename"
|
||||||
|
usage
|
||||||
|
else
|
||||||
|
if ! FileTest.exists?(filename)
|
||||||
|
puts "File #{filename} doesn't exist"
|
||||||
|
usage
|
||||||
|
end
|
||||||
|
end
|
||||||
jobnumber=sprintf("%06d", increasejobscounter)
|
jobnumber=sprintf("%06d", increasejobscounter)
|
||||||
|
puts "New job: #{jobnumber}"
|
||||||
|
File.copy(filename, "#{@basedir}/#{JOBSDIR}/#{jobnumber}")
|
||||||
|
File.chmod(RUNMODE, "#{@basedir}/#{JOBSDIR}/#{jobnumber}")
|
||||||
end
|
end
|
||||||
|
|
||||||
def createconfig
|
def createconfig
|
||||||
|
|
@ -178,7 +189,7 @@ createdirs
|
||||||
|
|
||||||
case command
|
case command
|
||||||
when "add" then addjob
|
when "add" then addjob
|
||||||
when "addfile", "af" then addjobfromfile ARGV
|
when "addfile", "af" then addjobfromfile
|
||||||
when "createconfig" then createconfig
|
when "createconfig" then createconfig
|
||||||
when "run" then master
|
when "run" then master
|
||||||
when "del" then deljob "$*"
|
when "del" then deljob "$*"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue