[Cialug] Command output logging
Andrew Denner
linux-list at upeke.com
Thu Nov 21 17:01:56 CST 2013
I believe that you need to run logrotate more frequently with a conf file
that would look like
/tmp/filename.log {
size 1k
copytruncate
}
where size is the size you want it to rotate at and copytruncate will
copy the logfile off and then truncate the original in case the
process that is writing to the log still has the file handle open.
I haven't actually tried this but it appears that it should do what
you want. (See http://www.thegeekstuff.com/2010/07/logrotate-examples/)
On Thu, Nov 21, 2013 at 4:37 PM, Kenneth Younger <kyounger at gmail.com> wrote:
> I have a somewhat custom daemon that allows me to specify in its config
> another command to redirect all the output to (for logging purposes). I see
> this as useful, since I'm generating quite a bit of log data each day, but
> don't really want to stop the program just to cut the log file and switch
> it over to a new one.
>
> I know of logrotate for log rotation, but is there a well known program
> that handles logging of arbitrary output data? (file naming (file.log.2,
> file.log.3, etc.), redirecting to new file every 100MB, etc.) Maybe
> logrotate can do this and I don't even know it...
>
> Thanks,
> -Kenny
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>
More information about the Cialug
mailing list