the below command when I run from the terminal will keep posting the output to message.log
cf logs broker-analytics > /var/www/cfbrokerlogs/message.log
However, if i close my terminal it will stop working. How do i make it run in the background all the time ? Also If for any reason if it stops execution what would a good approach to check that and make sure it is always running ?
The command simply prints the log when there is any entry made.
I am on a Ubuntu server 14.04.
You could use nohup
combined with &
:
nohup cf logs broker-analytics > /var/www/cfbrokerlogs/message.log &
The nohup
command causes the program to ignore hangup signals (i.e. those that are sent when closing the terminal), and the &
of course runs it in the background.
If you want to make sure it's still running or kill it, you can use ps
:
ps ax | grep cf logs broker-analytics
You should then be able to see the process ID, which you can kill
if necessary.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다