Work experience |

 Your Ad Here

Dont forget to emerge logrotate for gentoo |


I will allways emerge logrotate in fresh gentoo install, I will allways emerge logrotate in fresh gentoo install, I will allways emerge logrotate in fresh gentoo install, I will allways emerge logrotate in fresh gentoo install...

Doh, how could I forget such usefull thing. Yesterday I was checking logs in gentoo servers and found, that theyre about 1GB :O
Now seriously. When install gentoo (its linux from scratch) You need to install all daemons including syslog, crontab and so on by yourself. Thats very good, because you wont have any non-usable daemons, less risk to have exploitable stuff. Logrotate is must-have imho. It rotates logs, such as syslog, kernel log, creates old copies, compresses them, so you can check them and then simply delete. In my case I forgot to install it, so logs grown to 1GB size, thats way too much :/ Well that was lesson for me, now I wont forget that.
UPDATE: I would like to add some logrotate configuration aspects here. Here is my /etc/logrotate.d/syslog-ng config:

/var/log/messages { rotate 7 weekly size 50M sharedscripts postrotate /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true endscript } /var/log/syslog { rotate 7 weekly size 50M sharedscripts postrotate /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true endscript } /var/log/debug { rotate 7 weekly size 50M sharedscripts postrotate /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true endscript }

rotate count - Log files are rotated <count> times before being removed or mailed to the address specified in a mail directive. If count is 0, old versions are removed rather then rotated.
weekly - rotate logs weekly
size - force to rotate log if it reaches 50 Megabytes
To force rotate logs right now, just run:

# logrotate -f /etc/logrotate.conf

P.S. I think gentoo instalation howto should write this too.

UPDATE: Someone from gentoo related project gentoo-wiki found my article. I just can say, I'm glad to be usefull for gentoo comunity! You can visit their site http://gentoo-wiki.com/HOWTO_Setup_Logrotate

Comments:


Name:
captcha