John, I know you said log, but what really is a log? It's a text file (well 
most of the time, things like faillog excepted). Logroate can do what you
want to do. Basically you'd wanna create the report and then at the end of the 
process that runs the report, call logrotate with the force option (I'm
not sure if you can aim logrotate at a separate config file from the command 
line  - if you can you're golden). It will take care of rolling off the
oldest. The only difference is that the number is ascending. {filename}.txt = 
current {filename}.txt.1 -1 version {filename}.txt.2 -2 version, etc




             "McKown, John" <[EMAIL PROTECTED]>
             Sent by: Linux on 390 Port
             <[email protected]>                                          
                                                                   To
                                                                     
[email protected]
                                                                                
                                                                   cc
             07/17/2007 12:17 PM
                                                                                
                                                              Subject
                                                                     Re: 
Anything in UNIX like a z/OS GDG?
                            Please respond to
               Linux on 390 Port <[email protected]>








> -----Original Message-----
> From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On
> Behalf Of David Boyes
> Sent: Tuesday, July 17, 2007 11:44 AM
> To: [email protected]
> Subject: Re: Anything in UNIX like a z/OS GDG?
>
>

<snip>

> There is a C function called tmpnam that will create a temporary file
> name for you, but there isn't a concept of a GDG; you get a name
> generated by the call which is seldom human predictable.
>
> A suggestion, though: Rather than invent your own logging, use syslog.
> It's better integrated with management tools, and you don't have to
> worry about the file storage at all, and your operators only have one
> place to look for problems.
>
> For C or other compiled languages, #include syslog.h in your program,
> and then use openlog/syslog/closelog to write messages.
>
> For scripts, you can use 'logger' in to do the same job. Creating the
> log entry becomes something like:
>
> logger -p local0.notice -t MYHOST: 'Application Foo Borked Itself.
> Please check it.'
>
> Much easier and much more system management friendly.
>
> -- db

Hum, that's an idea. The only "negative" is that syslog does not
separate multiple executions of the program into different files. I
guess that I could put in a START and END type log information in that
case and then split the logger file based on that. Oh, and include the
PID just in case there are multiple, concurrent executions of the
program. Definately something to consider. That's what my z/OS ftp
server does so that interspersed log records are attributed to the
correct client.

Oh, and I know that I said "log", but I really misspoke. This is more
like a report than a log. That is, it is something that a person might
want to review or email to an end user. I guess I'm not yet over
whatever it was that got ahold of me on the weekend. The brain is still
a bit fuzzy.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it.

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to