On Mon, Mar 1, 2010 at 7:10 PM, perumal316 <[email protected]> wrote: > Hi, > > I am writing a kernel module which does logging. Currently I am > writing the messages to a textfile. But I don't want this file to > become too big. > > Is there any way I can specify to delete the file if it exceeds a > certain size or write to a new file through kernel module?
There is a logrotate service that will periodically compress old logs and rename them, deleting old logs of a certain age. Eg. kmfoo.log will become kmfoo.log.gz.1, the old kmfoo.log.gz.1 will become kmfoo.log.gz.2, and the old kmfoo.log.gz.2 will become part of the bit bucket in the sky or something (depending on your logrotate configuration). (If I were smarter I'd reread the docs on it and put some pesky log files under its jurisdiction that I have trouble with on my webserver, actually). -- Registered Linux Addict #431495 For Faith and Family! | John 3:16! http://www.fsdev.net/ -- You received this message because you are subscribed to the Linux Users Group. To post a message, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit our group at http://groups.google.com/group/linuxusersgroup
