automation, monitoring, scripting, Uncategorized

How to send attachment from Linux

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 “”

zip -r /tmp/ /tmp/WLCs-peers-*.log.filtered

next command will send email with .zip attachment to

mpack -s “AVC and other data from WLCs” /tmp/

Mentioned commands can be executed from cron on a regular basis.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s