From 84776cb511a4bb4372b93ed94a6c780ade1c2b0d Mon Sep 17 00:00:00 2001 From: Ward Wouts Date: Fri, 30 Jan 2009 14:59:04 +0000 Subject: [PATCH] meer en beter --- pbatch/pb.rb | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/pbatch/pb.rb b/pbatch/pb.rb index 13831f1..70029d6 100755 --- a/pbatch/pb.rb +++ b/pbatch/pb.rb @@ -153,7 +153,18 @@ def master file.puts "0" } - +# echo 0 >"${basedir}/$runningfile" +# +# while sleep $waittime; do +# if [ $(cat "${basedir}/${runningfile}") -lt $maxproc ]; then +# # via ls omdat anders de globbing klote is +# jl=$(ls ${basedir}/jobs/) +# if [ -n "$jl" ]; then +# ${pbcommand} process & +# fi +# readconfig +# fi +# done end def deljob @@ -209,15 +220,35 @@ def unfail end def changeprio + puts "unimplemented" end def runprocessor +# incrementrunning +# sleep 1 +# runjob=$(getjob) +# if [ -n "${runjob}" ]; then +# echo "Starting job: ${runjob}" +# owd=$(pwd) +# cd "${basedir}/processors/${runjob}" +# if "${basedir}/processors/${runjob}/job" 2>&1 > "${basedir}/processors/${runjob}/output" ;then +# finishjob ${runjob} +# echo "Finished job: ${runjob}" +# else +# failjob ${runjob} +# echo "Failed job: ${runjob}" +# fi +# cd $owd +# fi +# decrementrunning end def stop + puts "unimplemented" end def stopall + puts "unimplemented" end pbcommand = $0 @@ -232,16 +263,16 @@ case command when "addfile", "af" then addjobfromfile when "createconfig" then createconfig when "run" then master - when "del" then deljob "$*" + when "del" then deljob when "help" then usage when "-h" then usage when "park" then parkjobs when "unpark" then unparkjobs - when "retry" then unfail "$*" - when "prio" then changeprio "$*" - when "process" then runprocessor "$*" + when "retry" then unfail + when "prio" then changeprio + when "process" then runprocessor when "status", "st" then status - when "stop" then stop "$*" + when "stop" then stop when "stopall" then stopall else usage end