Walt Mankowski on 22 Sep 2009 19:21:37 -0700

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

Re: [PLUG] correct way to do this in bash

On Tue, Sep 22, 2009 at 08:55:03PM -0400, Jason Harlow wrote:
> Nevermind...I had a brain fart on what i was trying to do.. I doubt that's
> the way to go.
> I'd use cronolog like David said
> Something like:
> process | cronolog outputFile.%m%d%y_%H%M%S --period="24 hours" &

cronolog looks cool, but it might be tough to get it to cycle at 8
AM.  I suppose you could do hourly files and then concatenate them to
the periods you want.

Another solution no one's suggested yet is to change the log files
directly in your program.  Instead of writing do stdout and stderr,
you'd need to open file handles to the files.  Then you'd either have
to check the time before each write or use alarm(2) to set a signal
for when you need to close and reopen the files (or call freopen(3)).


Attachment: signature.asc
Description: Digital signature

Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug