[aklug] Re: linux bash backgrounding and I/O redirection

From: Jim MacDonald <jim@macdonald.org>
Date: Mon Jul 23 2012 - 18:21:02 AKDT

How did you redirect? 2>&1 ??

On Jul 23, 2012, at 16:01, Jeremy Austin <jhaustin@gmail.com> wrote:

> On Mon, Jul 23, 2012 at 3:48 PM, techno curmudgeon
> <technocurmudgeon@gmail.com> wrote:
>> Hey folks,
>>=20
>> It's been a while since I've done much scripting, and my bash-fu is
>> embarrassingly lacking now. Anyway, if someone can give me a pointer
>> I'd appreciate it.
>>=20
>> I'm having bash backgrounding and file redirection issues. I expect
>> it's something simple and obvious, and I'm ok with that 8).
>>=20
>> OVERVIEW:
>>=20
>> I need to attach to a remote sensor box and record the ascii
>> datastream from that box onto disk files. I'd like to break
>> that datastream into segments of about 10 minutes each with a datetime
>> stamp suffixed onto the filename.
>>=20
>> To that end, I've got a bash script generates a filename, connects to
>> the remote box using nc, and > to the filename. (note that I've
>> set the timing in the attached code to 1 minute, rather than 10 minutes).=

>>=20
>=20
>=20
> I wonder if this is any help?
>=20
> http://stackoverflow.com/questions/526782/how-do-i-limit-the-running-time-=
of-a-bash-script
>=20
> http://www.pixelbeat.org/scripts/timeout
>=20
> http://redflo.de/tiki-index.php?page=3DBash+script+with+timeout+function
>=20
> I myself do something similar to using nc, although in my case I am
> logging MP3 data, and using socat, which has a -T timeout option; in
> my case however, I am rolling over to a new timestamp whenever no data
> has been received > $TIMEOUT seconds. I don't think this will help
> you, so I won't post my script here.
>=20
> I think the above examples, with launching a subshell and then killing
> it after sleep n, might be what you want.
>=20
> jermudgeon
> ---------
> To unsubscribe, send email to <aklug-request@aklug.org>
> with 'unsubscribe' in the message body.
>=20
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Mon Jul 23 18:21:14 2012

This archive was generated by hypermail 2.1.8 : Mon Jul 23 2012 - 18:21:14 AKDT