[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: screen, detached, stdout

From: Andrew McGlashan
Subject: Re: screen, detached, stdout
Date: Sat, 12 Feb 2011 05:33:08 +1100
User-agent: Thunderbird (Windows/20100228)


Nico Schlömer wrote:
I would like to start a series of jobs in the background and log their
stdout in specific files. The idea is to use screen for this, and I
went ahead and typed

$ screen -d -m /path/to/my/exec

which puts the job nicely in the background. Let's log stdout:

$ screen -d -m /path/to/my/exec | tee output.log

What's wrong with using the -L option?

As a test, I created the following alias and ran it fine.

# alias ns9='if [ -f screenlog.0 ];then rm screenlog.0;fi && (/usr/bin/screen -S root -L -d -m time /usr/local/bin/; tail -99f screenlog.0) && mv screenlog.0 my-test-screenlog.out'

# ns9

That seems to work nicely!

And I know it's finished when I see the "time" output.

If you want to run multiple sessions, then you might need to create a working directory for each one and start the command in each directory so that it will always have it's own screenlog.0 file.


Kind Regards

Andrew McGlashan
Broadband Solutions now including VoIP

reply via email to

[Prev in Thread] Current Thread [Next in Thread]