bsubs
option | description | example |
-E | Runs the specified job-based pre-execution command on the execution host before actually running the job. | |
-Ep | Runs the specified job-based post-execution command on the execution host after the job finishes. | |
-e | Appends the standard error output of the job to the specified file path. | |
-g | group job | bsus -g /group_job_name |
demo
前处理和后处理(pre/post execution)
bsub -E 'echo pre > pre.${LSB_JOBID}.log' -Ep 'echo post > post.${LSB_JOBID}.log' sleep 10
环境变量LSB_JOBID是LSF为每一个作业设置的专有环境变量,内容为作业ID
bsub -o lsf/`date +%Y%m`/%J.out -e lsf/`date +%Y%m`/%J.err
bjobs
-w:
bqueues
bkill
group
bsub -g /group_job_name
bkill -g /group_job_name 0
获得PID
bsub -q gui -I calibre -drc -batch & pid=$!
获得JOBID
function nk_jobid {
output=$($*)
echo $output | head -n1 | cut -d'<' -f2 | cut -d'>' -f1
}
jobid=$(nk_jobid bsub pwd)