I've modified the syslogd source to include a thread that will keep track of a timer(or a timer thread). My intention is to check the file size of /var/log/messages in every one minute & if the size is more than 128KB, do a echo " " > /var/log/messages, so that the file size will be set back to zero.
If somebody can help me with a sed command to check the size of messages & to do a echo "" > messages ,if the size is greater than 128KB, I'll really grateful.
Now I'm using a busybox find, which doesn't have support for "-size" argument
So i think a sed command that meets the requirement would be great.
Please provide a sed command to check the file & then flush that file.
The output of
root@WiMAX-BS:/var/log ls -ld /var/log/messages
-rw------- 1 root root 41994 Jan 23 03:16 /var/log/messages
==========
Well.. I was thinking like
1) use the ls command grab the size value using the sed and
2) then if it is greater than 128KB, do an echo " " > /var/log/messages
Now I've crond support, so I can add a script with above logic to cron job.