I think you're looking for logrotate, which is part of the default install and should already be doing at least some of that work ie creating a new log every so often and compressing the old ones.
You can set various params, and if you look at the working cfgs & docs, you'll see you can call a script during the process.
If you want to send backups to eg another machine, you'll have to add a script, probably using rsync.
Really, we need a more detailed spec of what you are trying to achieve.
|