Skip to main content
add a link
Source Link
sds
  • 2.1k
  • 2
  • 23
  • 34

I use nohupnohup quite often for important long running processes under linux/bash, so much so that nohup time my command with arguments && mv nohup.out my.log is almost an idiom for me.

The problem is that nohup puts both stdout and stderr into nohup.out, and I cannot control the name of the file. This means that if I accidentally start two nohups in the same directory, their output will be interleaved in nohup.out.

The questions are:

  1. How do I deal with this problem? Always running nohups in separate directories and writing a shell function which will first check for ./nohup.out are two sucky options I see.

  2. How come I cannot tell nohup.outnohup where to redirect the output? GNU tools tend to have so many options, why not nohup?

I use nohup quite often for important long running processes under linux/bash, so much so that nohup time my command with arguments && mv nohup.out my.log is almost an idiom for me.

The problem is that nohup puts both stdout and stderr into nohup.out, and I cannot control the name of the file. This means that if I accidentally start two nohups in the same directory, their output will be interleaved in nohup.out.

The questions are:

  1. How do I deal with this problem? Always running nohups in separate directories and writing a shell function which will first check for ./nohup.out are two sucky options I see.

  2. How come I cannot tell nohup.out where to redirect the output? GNU tools tend to have so many options, why not nohup?

I use nohup quite often for important long running processes under linux/bash, so much so that nohup time my command with arguments && mv nohup.out my.log is almost an idiom for me.

The problem is that nohup puts both stdout and stderr into nohup.out, and I cannot control the name of the file. This means that if I accidentally start two nohups in the same directory, their output will be interleaved in nohup.out.

The questions are:

  1. How do I deal with this problem? Always running nohups in separate directories and writing a shell function which will first check for ./nohup.out are two sucky options I see.

  2. How come I cannot tell nohup where to redirect the output? GNU tools tend to have so many options, why not nohup?

Source Link
sds
  • 2.1k
  • 2
  • 23
  • 34

nohup output redirection to a different file

I use nohup quite often for important long running processes under linux/bash, so much so that nohup time my command with arguments && mv nohup.out my.log is almost an idiom for me.

The problem is that nohup puts both stdout and stderr into nohup.out, and I cannot control the name of the file. This means that if I accidentally start two nohups in the same directory, their output will be interleaved in nohup.out.

The questions are:

  1. How do I deal with this problem? Always running nohups in separate directories and writing a shell function which will first check for ./nohup.out are two sucky options I see.

  2. How come I cannot tell nohup.out where to redirect the output? GNU tools tend to have so many options, why not nohup?