LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How tol limit the file to fixed size? (https://www.linuxquestions.org/questions/linux-general-1/how-tol-limit-the-file-to-fixed-size-536741/)

sudevank 03-12-2007 02:29 AM

How tol limit the file to fixed size?
 
Hi,
I want to limit the file size to 100MB(say0. but i should able to add details (log messages). I dont want the old details in the file ie need only recent updates.( a mechanism which work as a FIFO or pipe )

jlliagre 03-12-2007 03:10 AM

Have a look at the "logrotate" command.

sudevank 03-12-2007 03:43 AM

Quote:

Originally Posted by jlliagre
Have a look at the "logrotate" command.

let me try that.
I have lot of log files dynamicly created with differnt file names.
is there any utility that can implement easly in this contest?

timmeke 03-12-2007 05:29 AM

logrotate allows you to specify log names with wildcards (ie to rotate all logs in a certain directory).
See "man logrotate", especially also "olddir" option.

sudevank 03-13-2007 04:33 AM

Quote:

Originally Posted by timmeke
logrotate allows you to specify log names with wildcards (ie to rotate all logs in a certain directory).
See "man logrotate", especially also "olddir" option.

Ihi i dont want to depends on another program.Is there any methord which give full control for me i want a mechanism where i can write my log to a file if it reached the maxsize the older entries automatically remove(from same file no need to back up and all).


All times are GMT -5. The time now is 09:26 PM.