如何在服务器中批量递交任务

仅限用于SLURM调配系统的服务器递交任务

#!/bin/bash

# this is for sub jobs for uBAMs
mkdir -p job
job_directory=$PWD/job


for i in $(ls *.gz $pwd | sed s/.trimmed_R[12].fq.gz// | sort -u); do

    job_file="${job_directory}/${i}.job"

    echo "#!/bin/bash
#SBATCH --job-name=${i}.job
#SBATCH --output=./${i}.out
#SBATCH --error=./${i}.err
#SBATCH --time=2:00:00
#SBATCH --cpus-per-task=5
#SBATCH --mem=5g
module load picard
java -Xmx4G -XX:ParallelGCThreads=5 -jar ../picard.jar FastqToSam TMP_DIR=../tmp F1=../${i}.trimmed_R1.fq.gz F2=../${i}.trimmed_R2.fq.gz O=../../uBAM/${i}_fastqtosam.bam SAMPLE_NAME=${i} PLATFORM=illumina" > $job_file
    sbatch $job_file
done

小心路径

你可能感兴趣的:(如何在服务器中批量递交任务)