Can I suppress an LSF job report without sending mail?
Asked Answered
S

5

10

I would like to submit a job with Platform LSF and have the output placed in a file (bsub -o), without a job report at the end of it. Using bsub -N removes the job report from the file, but instead sends the report via e-mail. Is there a way to suppress it completely?

Shipmate answered 27/1, 2012 at 18:36 Comment(0)
S
6

How about redirecting the output of the command to a file and sending the report to /dev/null:

bsub -o /dev/null "ls > job.\$LSB_JOBID.out"
Selfjustifying answered 27/1, 2012 at 23:31 Comment(1)
This may be the only way to do it. Having to add in another layer of wrapper is clunky, though.Shipmate
D
10

As explained in http://www-01.ibm.com/support/knowledgecenter/SSETD4_9.1.2/lsf_admin/email_notification.dita , you can set the environment variable LSB_JOB_REPORT_MAIL=N at job submission to disable email notification, e.g.:

LSB_JOB_REPORT_MAIL=N bsub -N -o command.stdout command options

Doubledecker answered 28/1, 2015 at 13:32 Comment(0)
S
6

How about redirecting the output of the command to a file and sending the report to /dev/null:

bsub -o /dev/null "ls > job.\$LSB_JOBID.out"
Selfjustifying answered 27/1, 2012 at 23:31 Comment(1)
This may be the only way to do it. Having to add in another layer of wrapper is clunky, though.Shipmate
T
3

I managed to make this work by using the -N switch as suggested to bsub AND suppressing email delivery by using the environment variable:

For (t)csh users:

setenv LSB_JOB_REPORT_MAIL N

For Bourne shell and their variants:

export LSB_JOB_REPORT_MAIL=N

It's a bit convoluted, but it gets the job done.

Ticon answered 30/4, 2015 at 20:8 Comment(0)
Z
0

I can think of two ways to do this. One is a bit of a "sledgehammer" approach, but maybe would work for you.

First, you could set up some email alias that is the email equivalent of /dev/null, and then use the -u option to bsub to send the email report to that user.

Second (the sledgehammer), you could set LSB_MAILPROG in the LSF configuration to point to a sendmail wrapper script that could either a) parse the report and bin it based on certain text matches, or b) bin all email.

Otherwise you're kind of stuck with the header in file indicated by -o.

Zook answered 27/1, 2012 at 22:3 Comment(2)
Unfortunately, when I run thousands of jobs, sending the e-mails will be too much load on the mail server. I also can't change the LSF configuration.Shipmate
A common complaint with LSF. Maybe it's worth it for the admin to disable email reporting using the LSB_MAILPROG trick. :-)Zook
N
0

Use a combination of "-o", "-e", "-N" and "-u /dev/null" on the bsub command line to completely suppress job report and e-mail, e.g.:

$ bsub -N -u /dev/null -o command.stdout -e command.stderr command options

Unfortunately, this would also disable completely any reports of job failures.

Nicker answered 2/7, 2013 at 2:50 Comment(1)
Won't this cause mail to be sent to /dev/null@localdomain? My sysadmin really doesn't like that.Shipmate

© 2022 - 2024 — McMap. All rights reserved.