You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why don't you use logrotate for rolling over logs?
It's directly built into debian and supports restarting services and loads of other stuff.
You don't even need a cronjob, single file in /etc/logrotate.d and you're done.
It has loads of config options.
The text was updated successfully, but these errors were encountered:
Looks interesting. I am looking for something to provide purging of all logs, as well as world and server backups. This might be a partial or total solution.
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.
I've played around with a config file which you can put in /etc/logrotate.d/ . You can test configs with logrotate -d -f
# Sample wildcard
/opt/msm/servers/*/server.log {
# Running with cron.daily time
daily
olddir /opt/msm/archives/logs/
# Keeps a fortnight
rotate 14
# Don't rotate empty logs
notifempty
}
The issue with this is old logs are located in separate folders for each server in /opt/msm/archive/logs/ which cannot be interpreted to the olddir directive. If a unified folder is used for all the servers there is a conflict of names, because all the logs are named server.log. What I think could work is something like this where each server is appended after its created with MSM
# Main config file to which each server is appended
daily
rotate 14
notifempty
Why don't you use logrotate for rolling over logs?
It's directly built into debian and supports restarting services and loads of other stuff.
You don't even need a cronjob, single file in
/etc/logrotate.d
and you're done.It has loads of config options.
The text was updated successfully, but these errors were encountered: