There are some cases when its needed to send via email many scripts output results from Linux command line. Here is an working example to achieve this.
It is expected that email options have been already configured so that mail command is working.
Below is the example of command which will zip all related logs from /tmp folder into a .zip file “WLCs_logs.zip”
zip -r /tmp/WLCs_logs.zip /tmp/WLCs-peers-*.log.filtered
next command will send email with .zip attachment to email@example.com
mpack -s “AVC and other data from WLCs” /tmp/WLCs_logs.zip firstname.lastname@example.org
Mentioned commands can be executed from cron on a regular basis.