Sunday, October 4, 2009

Submit a bunch of jobs to SGE using a file as a template

This script takes a filename from the third whitespace separated field of each file of the file "work-to-do" it uses this as the argument of a command (at /home/user/stuff/bin/stuff). The second argument of this command is the directory of the first argument. The third is a name generated from the current date. These commands are generated and then submitted to an SGE queue using qsub (the queue is called myqueueq). As always probably useless to anyone but me.

awk '{print "cd /home/user/stuff;./bin/stuff "$3" `dirname "$3"` auto-`date +%Y-%m-%dT$H-%M-%S`"}' work-to-do > sgecommands

awk '{print "echo \"" $0 "\" > /tmp/regen_run;qsub -q myqueueq /tmp/regen_run"}' sgecommands

1 comment:

nobodycares said...

Jesus - that's just wrong.