I just added a new page to the Linux notebook [fluggart.com] section of my website. The new page [fluggart.com] describes how to write a shell script that will automatically rotate log files in Linux.
The primary reason I decided to post that script was so that if I ever needed to write something like that again in the future, it would be right at my fingertips. It actually took me a while to learn enough about shell scripts to write that particular script, even though it is very basic.
Rotating log files can be important, because it prevents the volume containing /var from becoming full (which will cause bad things to happen). I pretty much only use Debian, and the installation automatically sets up cron jobs to rotate the log files. However, I have seen installations which, for various reasons, did not end up having a built-in mechanism for rotating these files. In addition, a user might want to write their own shell script to rotate the log files so that they will get rotated on a different schedule than the default.
On the page, I posted the contents of the shell script, as well as instructions for uploading the script to the crontab spool.
New pages to my Linux Notebook are a lot less common right now. I have not had as much time to write new pages. Also, I am more hesitant to convert the rest of my notes into a format I can post onto the web. Some of my notes contain information that could allow someone to break into my machine. And some of my solutions to various problems that I have had in Linux are hacks, and I would be embarassed for people to see those solutions (even though they work).
Anyway, hopefully, someone needing to write a similar script may be able to benefit from the new page I created.



<< Home