Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have to make a utility that can monitor a log file and if it reaches some size (say 1k), it should create another file in rotation and compress and zip it. I want to use existing utility of Linux like logroate. But logrotate is not working properly here. Can any body tell me the reason.
Folllowings are logroate configuration
linux system kernel 18.104.22.168
I am modifying /etc/logrotate.conf like this
/rmem/slave //file name
According to above configuration, logrotate should monitor the file /rmem/slave, once the file reaches its size 1 kilo byte, it should create new file and conpress and zipped it like slave.1.gz.
in ths same way it should create slave.2.gz, on reaching another 1 kilo byte in the same way slave.3.gz should also be created once size reaches another 1k,and similarly slave.4.gz
My Question is here this size command is not working properly in logrotate.conf
i have mentioned here 1k, but it is not creating zip file after /rmem/slave reaches 1k,but when it reaches 100k -200k, then it is creating the new file. and also it is creating the zip file of 10k sometime 9k, sometime 11 k
I am not understanding the behavior of size in logrotate.conf
When you are talking about 1 kilobyte you are referring to a very small amount of data. My guess is log rotate is getting confused and not able to function as your file size designated is way to small thus it might be trying to force itself into to many actions too fast. Hence the 100-200k.. My belief at this point is logrotate has a limit on the minumum size of file it can work with but I'm only speculating on this. Now if you said 1 MB or 100Kilobyte, this might allow it to work properly.
I would do a search and look for something along the lines of "what is the minumum file size logrotate can operate on".. This may or may not provide some clues.