Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

Not really. There are tools that can detach a process from its output file and attach it to the current terminal — see How can I disown a running process and associate it to a new screen shell?How can I disown a running process and associate it to a new screen shell?. However:

  • These tools operate via a debugging interface (ptrace) and modify the execution of the program in an underhanded way. This can crash some programs.
  • If it works, the output will be on the terminal instead of the log file where it's supposed to go, not in addition to the log file.
  • The output emitted before running the tool will be in the log file only.

The output of a cron job will be logged somewhere: either the script in the crontab redirects the output to a file, or cron will send the output to the administrator by email. Check the crontab entry to see where the output goes.

On Linux, you can check where the output of a process goes by looking at its file descriptors in /proc/PID/fd/. File descriptor 1 is standard output and 2 is standard error.

Not really. There are tools that can detach a process from its output file and attach it to the current terminal — see How can I disown a running process and associate it to a new screen shell?. However:

  • These tools operate via a debugging interface (ptrace) and modify the execution of the program in an underhanded way. This can crash some programs.
  • If it works, the output will be on the terminal instead of the log file where it's supposed to go, not in addition to the log file.
  • The output emitted before running the tool will be in the log file only.

The output of a cron job will be logged somewhere: either the script in the crontab redirects the output to a file, or cron will send the output to the administrator by email. Check the crontab entry to see where the output goes.

On Linux, you can check where the output of a process goes by looking at its file descriptors in /proc/PID/fd/. File descriptor 1 is standard output and 2 is standard error.

Not really. There are tools that can detach a process from its output file and attach it to the current terminal — see How can I disown a running process and associate it to a new screen shell?. However:

  • These tools operate via a debugging interface (ptrace) and modify the execution of the program in an underhanded way. This can crash some programs.
  • If it works, the output will be on the terminal instead of the log file where it's supposed to go, not in addition to the log file.
  • The output emitted before running the tool will be in the log file only.

The output of a cron job will be logged somewhere: either the script in the crontab redirects the output to a file, or cron will send the output to the administrator by email. Check the crontab entry to see where the output goes.

On Linux, you can check where the output of a process goes by looking at its file descriptors in /proc/PID/fd/. File descriptor 1 is standard output and 2 is standard error.

Source Link
Gilles 'SO- stop being evil'
  • 865.5k
  • 205
  • 1.8k
  • 2.3k

Not really. There are tools that can detach a process from its output file and attach it to the current terminal — see How can I disown a running process and associate it to a new screen shell?. However:

  • These tools operate via a debugging interface (ptrace) and modify the execution of the program in an underhanded way. This can crash some programs.
  • If it works, the output will be on the terminal instead of the log file where it's supposed to go, not in addition to the log file.
  • The output emitted before running the tool will be in the log file only.

The output of a cron job will be logged somewhere: either the script in the crontab redirects the output to a file, or cron will send the output to the administrator by email. Check the crontab entry to see where the output goes.

On Linux, you can check where the output of a process goes by looking at its file descriptors in /proc/PID/fd/. File descriptor 1 is standard output and 2 is standard error.