Disable job email

Procedure

  • specify stdout and stderr as the files for the output and error options (-o, -oo, -e, and -eo).
    For example, the following command directs stderr and stdout to file named /tmp/job_out, and no email is sent.
    bsub -o /tmp/job_out sleep 5
    
  • On UNIX, for no job output or email specify /dev/null as the output file:
    bsub -o /dev/null sleep 5
    

Results

The following example submits myjob to the night queue:

bsub -q night -i job_in -o job_out -e job_err myjob

The job reads its input from file job_in. Standard output is stored in file job_out, and standard error is stored in file job_err.

By default, LSF sends email to users when their jobs finish. It may not be desirable to receive email after submitting a lot of jobs, and it may be difficult to change job scripts with short notice, especially if those job scripts are shared between users who want email and users who don't. Therefore, LSF provides a simple way to disable the sending of job level email notification from the cluster. When the administrator sets LSB_JOB_REPORT_MAIL in lsf.conf, email notification for all jobs is disabled. All sbatchds must be restarted on all hosts. However, end users can set the value for LSB_JOB_REPORT_MAIL in the job submission environment to disable email notification for only that particular job and not email for all jobs. In this case, there is no need to restart sbatchd.

If you define LSB_JOB_REPORT_MAIL as N, no mail will be sent by sbatchd and it doesn’t affect email sent by mbatchd. It also means you do not have to change your job script.

When defining LSB_JOB_REPORT_MAIL, note the following:
  • esub: If you submit a job using bsub –a xxx and don’t want sbatchd to send email, you can set LSB_JOB_REPORT_MAIL=N|n before submitting the job. You can also change this parameter's value using LSB_SUB_MODIFY_ENVFILE in the esub script. However, when using bmod with esub, you cannot change the value of this parameter even if you use LSB_SUB_MODIFY_ENVFILE in the esub script.

  • Chunk job: After the job is done, the submitter or mail user will receive email from sbatchd. If you set LSB_JOB_REPORT_MAIL=N|n before submitting the job, no email will be sent by sbatchd.

  • MultiCluster: When a job is forwarded from the sending cluster to the execution cluster, sbatchd in the execution cluster sends email to the job’s submitter or mail user. If you set LSB_JOB_REPORT_MAIL=N|n before submitting the job, no email will be sent by the execution cluster’s sbatchd.

  • Job re-run: When a job is scheduled to rerun on another host, sbatchd will send the email to the submitter or mail user. If you set LSB_JOB_REPORT_MAIL=N|n before submitting job, no email will be sent. If you change the value of LSB_JOB_REPORT_MAIL before rerunning the job, the new value will not affect sbatchd.

  • Checkpoint job restart: If you set LSB_JOB_REPORT_MAIL=N|n before submitting a checkpoint job, no email will be sent by sbatchd when the job is done. If you want to restart the checkpoint job and don’t want sbatchd to send email, set LSB_JOB_REPORT_MAIL=N|n before restarting the job.

  • Pre-execution specified during job submission or in CLI: If you submit a job using bsub –E pre-exec, sbatchd will send an email to the job’s submitter or mail user when the job is done. If you don’t want sbatchd to send email, set LSB_JOB_REPORT_MAIL=N|n before submitting the job. If you change the value of LSB_JOB_REPORT_MAIL in the pre-execution script, the new value will not affect sbatchd’s sending mail action on the execution host.

  • Pre-execution or job-starter at the queue level: If you submit a job using bsub –q queueName, sbatchd will send email to the job’s submitter or mail user when the job is done. If you don’t want sbatchd to send email, set LSB_JOB_REPORT_MAIL=N|n before submitting the job. If you change the value of LSB_JOB_REPORT_MAIL in the pre-execution or job-starter script, the new value will not affect sbatchd’s sending mail action on the execution host.