background jobs with nohup and & - Linux

This is a discussion on background jobs with nohup and & - Linux ; I am have a program runs under alfha. The program sends output to the shell and file. My problem is that although the program runs in the background and it still send the output to my shell, and i can ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: background jobs with nohup and &

  1. background jobs with nohup and &

    I am have a program runs under alfha.
    The program sends output to the shell and file.
    My problem is that although the program runs in the background and it
    still send the output to my shell, and i can not see the nohup.out
    file
    the server OS is REDHAT 6.10
    Thanks

  2. Re: background jobs with nohup and &

    In article <5b97e376.0310151124.580fe46a@posting.google.com>, Shamli wrote:
    > I am have a program runs under alfha.
    > The program sends output to the shell and file.
    > My problem is that although the program runs in the background and it
    > still send the output to my shell, and i can not see the nohup.out
    > file
    > the server OS is REDHAT 6.10


    At least for RHL 8.0, the nohup info page says it sends
    output to a file, but when I ran 'nohup ls' it sent the
    output to the xterm from which the command was launched.
    Maybe the info page might be inaccurate.

    I don't know about alfha.

    If you're just trying to run a command in the background
    with output sent to a file, why not just do that? I use
    C-shell (/bin/csh) and normally do

    somecommand < /dev/null >& output.file &

    There is some cryptic substitute for '>&' if you're using
    bash, but I'm not acquainted with what it is.

    For good measure, I often launch the command from an xterm I
    created just to launch that one command. After the command
    is launched, I terminate the xterm.

    Good luck.

    Robert Riches
    spamtrap42@verizon.net
    (Yes, that is one of my email addresses.)

  3. Re: background jobs with nohup and &

    "Robert M. Riches Jr" writes:

    > C-shell (/bin/csh) and normally do
    >
    > somecommand < /dev/null >& output.file &
    >
    > There is some cryptic substitute for '>&' if you're using
    > bash, but I'm not acquainted with what it is.


    >& works in bash as well. &> does the same thing.


    --
    Måns Rullgård
    mru@users.sf.net

  4. Re: background jobs with nohup and &

    Robert M. Riches Jr wrote:
    > In article <5b97e376.0310151124.580fe46a@posting.google.com>, Shamli wrote:
    >> I am have a program runs under alfha.

    >
    > At least for RHL 8.0, the nohup info page says it sends
    > output to a file, but when I ran 'nohup ls' it sent the
    > output to the xterm from which the command was launched.


    That way your stdio is attached to a terminal you happen to
    be using so this is not a big surprise

    > Maybe the info page might be inaccurate.


    Maybe not the most clear. Here what is says among other things:

    `nohup' does not automatically put the command it runs in the
    background; you must do that explicitly, by ending the command line
    with an `&'.

    There is really no point of running nohup jobs in a foreground as
    this is not doing anything really exciting. Also jobs running from
    'cron' or 'at' really do not have "backgroud" so using nohup there
    does not make much sense either (by default stdout and stderr to
    of such jobs is piped to some mail user agent, a.k.a. MUA) so nohup
    is really for an interactive use.

    Try 'nohup ls &' and see what will happen. :-) You can indeed
    redirect output of these commands to some other file than 'nohup.out'
    but you will have to do that explicitely.

    Michal

  5. Re: background jobs with nohup and &

    In article <5b97e376.0310151124.580fe46a@posting.google.com>, Shamli wrote:
    > I am have a program runs under alfha.
    > The program sends output to the shell and file.
    > My problem is that although the program runs in the background and it
    > still send the output to my shell, and i can not see the nohup.out
    > file
    > the server OS is REDHAT 6.10


    It's difficult to guess the answer without seeing exactly what you are
    doing: "send output to the shell and file"--how?

    The nohup.out file only gets created if the output of the 'nohupped'
    command in not redirected.

    --
    Dave Brown Austin, TX

+ Reply to Thread