Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
howto limit size of the log files ?
howto limit size of the log files ?
hi
I have enabled syslog on my mail appliance.
Now I get on my Debian Sarge Stable in:
/var/log/appliance/messages
a very big logfile.
howto limit these log files to 1000k ?
I've looked at man logrotate
I've created following entries in /etc/logrotate.conf :
/var/log/appliance/messages /var/log/appliance/error.log {
weekly
size=+1000k
create 0664 root utmp
rotate 2
}
but it seems, I cannot limit the size.
greetings
cc
I have enabled syslog on my mail appliance.
Now I get on my Debian Sarge Stable in:
/var/log/appliance/messages
a very big logfile.
howto limit these log files to 1000k ?
I've looked at man logrotate
I've created following entries in /etc/logrotate.conf :
/var/log/appliance/messages /var/log/appliance/error.log {
weekly
size=+1000k
create 0664 root utmp
rotate 2
}
but it seems, I cannot limit the size.
greetings
cc
Don't know if this is a typo or not, but I think this line...
ought to read...
Also I think you need to remove the line...
At least that's what I get from the logrotate man page. Hope that's helpful.
Cheers
Code: Select all
size=+1000k
Code: Select all
size 1000k
Code: Select all
weekly
Cheers
hi
I've created a new file in /etc/logrotate.d/appliance with the following entries:
lacek is is right !
I cannot limit the size, but logrotate runs daily and new file will be created each time.
maybe someone has a perl script to check from cron and limit the size of the logfiles ?
greetings
cc
I've created a new file in /etc/logrotate.d/appliance with the following entries:
Code: Select all
weekly
maxage 28
size=1000k
create 0664 root utmp
rotate 2
I cannot limit the size, but logrotate runs daily and new file will be created each time.
maybe someone has a perl script to check from cron and limit the size of the logfiles ?
greetings
cc
Read the man page for logrotate, you can limit by size. Your syntax is wrong.
Straight from the man page...
Don't give up, and certainly don't write a script when it isn't necessary. (Though it would be an easy script to write.)
Straight from the man page...
bold added for emphasis.logrotate is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large.
Don't give up, and certainly don't write a script when it isn't necessary. (Though it would be an easy script to write.)
what's wrong in my syntax ?Anonymous wrote:Read the man page for logrotate, you can limit by size. Your syntax is wrong.
Straight from the man page...
bold added for emphasis.logrotate is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large.
Don't give up, and certainly don't write a script when it isn't necessary. (Though it would be an easy script to write.)
can you give pls some more details how it should work to limit the size ?
I couldn't find out.
greetings
cc
I think the syntax ought to look like so...
I removed weekly, because you don't want your log rotated weekly, and I removed maxage because it isn't in the documentation.
Do remember that logrotate is usually run as a cron job. This means that logrotate will only notice and rotate a file exceeding your size directive when cron runs logrotate.
Please if someone knows better, speak up. I don't have any logs that get large quickly so I don't haven't been able to test this.
The example of size based rotation on the man page looks like so...
Code: Select all
/path/to/logfile {
size 1M
create 0664 root utmp
rotate 2
}
Do remember that logrotate is usually run as a cron job. This means that logrotate will only notice and rotate a file exceeding your size directive when cron runs logrotate.
Please if someone knows better, speak up. I don't have any logs that get large quickly so I don't haven't been able to test this.
The example of size based rotation on the man page looks like so...
Code: Select all
"/var/log/httpd/access.log" /var/log/httpd/error.log {
rotate 5
mail www@my.org
size 100k
sharedscripts
postrotate
/usr/bin/killall -HUP httpd
endscript
}
It is because the logrotate setting means "Touch the file if its size is at least 1M". Obviously, logrotate does not run all time, so it can check file sizes when it is run by cron. If the file grown much large in that time, it will back it up, but it won't prevent file to grow large.
Again: you cannot limit the log files' size. Since there is no point at all in doing so, I'm pretty sure that there is no program which would do it...
Again: you cannot limit the log files' size. Since there is no point at all in doing so, I'm pretty sure that there is no program which would do it...