syntax - unknown error in shell script -
i have cobbled shell script submit multiple jobs on cluster, appears without giving me error message, output files missing , error log files empty. script supposed
1.) make bunch of new directories,
2.) copy 4 files each (mainparams, extraparams, infile, , structurejobsubmissionfile)
3.) submit each 1 cluster run structure while changing 1 parameter in mainparams file every tenth directory (that's 's/changethis/'$k'/g' line).
test running on front end gives no errors, structure program date on cluster, , cluster administrators don't see wrong. thanks!
#!/bin/bash reps=10 numk=10 k in $(seq $numk); in $(seq $reps); #make folder name (ex. k4rep7) tmpstr="k${k}rep${i}" #echo "making folder , filename $tmpstr" #make new folder mkdir $tmpstr #go folder cd ./$tmpstr #copy in input files cp ../str_in/* ./ #modify copied input file here source file remains same cp ./mainparams ./temp.txt #change maxpops current value of k , directory files current directory sed -e 's/changethis/'$k'/g' -e "s:pathforrunningstructurehere:$pwd:g" ./temp.txt > ./mainparams #get rid of temporary file rm ./temp.txt #inside $i run structure here qsub -q fnrgenetics -l nodes=1:ppn=1,walltime=20:00:00 structurejobsubmissionfile #go parent directory cd ../ done done
i can't see obviously wrong, think place you'll find answer lies in better logging , better error checking. of things you're not checking should:
- is
$tmpstr
created correctly? (will fail on disk full or if permissions not set correctly) - does
str_in/
exist, , directory? - does contain files?
- does contain
mainparams
? - is
qsub
in$path
? - does call qsub return error?
you can roll error logging function of own, or use package log4bash
Comments
Post a Comment