How to read a linux background process stream through java? -


on linux machine have 1 process running in background.i have process id of process.i want read stream output of process through java. command:

nohup sar -a 1 >/dev/null 2>&1 &

i redirecting output /dev/null i.e. nohup.out not created.

you can't use nohup , have output stream.

from nohup --help :

if standard output terminal, append output 'nohup.out' if possible, '$home/nohup.out' otherwise.

so either drop use of nohup , can use process's outputstream, or have read file.

obviously in both cases have stop redirecting output of command /dev/null, can either redirect file of choice or let nohup use default output file.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -