|
|||
|
How to tar.gz old maillog & messages during log rotation?
These logs are automatically tar.gz'd during the log rotation process:
exim_mainlog exim_rejectlog exim_paniclog chkservd.log However, these logs are not... and I'd like them to be, since /var is a little low on disk space: maillog messages Any pointers in accomplishing this, and any ideas why some logs are tar.gz'd and others are not? Thanks! - Scott |
|
|||
|
This is really quite simple to do.
Log into you server either via SSH or SFTP (I find it easier to edit files via SFTP/edit, but...) go to the folder /etc/logrotate.d And open/edit the file named syslog It should look simlar to this when you open it Quote:
The value of weekly tells logrotate how often to rotate the logs. Compress to gzip them, etc... If you google logrotate you will find all options available explaned and it's quite simple. Now be aware that if your syslog like mine is using a shared script for these log files... /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron Changing the value to compress will gzip all the files listed above. Easy to fix. Delete the following from that sharedscript line /var/log/maillog and we'll create a new entry just for that log file. And paste it below. Quote:
Quote:
Make the neccesary edits and save the file. You're all done! You can modify all your system log rotations in this folder using the same meathods. You can set them to rotate by size of file, monthly, yearly, howmany files to save/rotate, etc... You'll find the conf for non system files in the file etc/logrotate.conf You can test your logrotate for error by issueing this command in SSH it will 'force' the rotation of all files and print out the results to your screen /usr/sbin/logrotate -vf /etc/logrotate.conf Last edited by Hoss; 02-01-2010 at 01:56 PM. |
|
|||
|
That is the default setup is all
And some of us prefer logs to be compressed and some not, it's all about your prefs m8 You may want to reread what I entered above as I think I was editing my post when you posted. I just changed a few of the values is all. |
|
||||
|
Quote:
I recommend referring to the logrotate manual "man" documentation and help information as accessed via the following commands: Code:
# man logrotate # logrotate --help
__________________
For hands-on assistance please reference our new support information page: Where should I go for support? cPResources: Support Options - Additional Support Options - Forums Search - Mailing Lists(Alt) - Documentation -- cPanelDon - Donald Holl, Technical Analyst, cPanel Technical Support |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| log rotation broken? | disgust | cPanel and WHM Discussions | 7 | 04-23-2009 02:46 PM |
| Log Rotation | zigzam | cPanel and WHM Discussions | 3 | 03-02-2009 08:06 AM |
| Log rotation | bmcclure | cPanel and WHM Discussions | 0 | 08-18-2003 10:53 AM |
| Log Rotation | sketchified | cPanel and WHM Discussions | 43 | 12-10-2002 10:02 AM |
| Log Rotation? | Curious Too | cPanel and WHM Discussions | 0 | 06-02-2002 01:01 AM |