Submitting an interactive job and redirect streams to files

bsub -i, -o, -e

About this task

You can use the -I option together with the -i, -o, and -e options of bsub to selectively redirect streams to files. For more details, see the bsub(1) man page.

Procedure

To save the standard error stream in the job.err file, while standard input and standard output come from the terminal:
% bsub -I -q interactive -e job.err lsmake

Splitting stdout and stderr

About this task

If in your environment there is a wrapper around bsub and LSF commands so that end-users are unaware of LSF and LSF-specific options, you can redirect standard output and standard error of batch interactive jobs to a file with the > operator.

By default, both standard error messages and output messages for batch interactive jobs are written to stdout on the submission host.

Procedure

  1. To write both stderr and stdout to mystdout:
    bsub -I myjob 2>mystderr 1>mystdout
  2. To redirect both stdout and stderr to different files, set LSF_INTERACTIVE_STDERR=y in lsf.conf or as an environment variable.
    For example, with LSF_INTERACTIVE_STDERR set:
    bsub -I myjob 2>mystderr 1>mystdout

    stderr is redirected to mystderr, and stdout to mystdout.