im trying to write a bash which would take log records from all my Red hat servers, from /var/log/messages for a previous week and store them in a separate txt file. Can you please help me, especially with the "previous week" log records export stuff..
Hi and welcome
No need for bash.
This task can be solved via syslog and logrotate.
- have a central log server with enough disk space to hold the combined logs
- configure its syslogd, and then the syslogd of all your client nodes
- configure logrotate to weekly rotate the combined logs