Wednesday, 30 May 2018

Linux from the command line | Linux for sysadmins -- Sending mail from the command line

Linux from the command line | Linux for sysadmins -- Sending mail from the command line

I know we all have gotten used to having access to our e-mail everywhere, on every device, so the thought of sending e-mail from the command line may seem archaic and pointless, but quite the opposite. It's a really handy and powerful tool.
A simple example might be that you're a sysadmin working away on one of a dozen remote servers and you need to finish up editing a config file later. You could, right from the command line of that box, send yourself a quick reminder note and include the config file in question.
Or, more often this is a tool that comes in handy in custom scripts and cron tasks. For example, maybe you have a script that checks the status of a few key metrics on your network every week. It would be nice to be able to e-mail yourself the output rather than having to remotely log in and read log files.
Or, maybe you might have your system e-mail you when any of a list of critical issues occur. Eg, CPU temp crosses a threshold. A certain file-system gets more than nn% full.
https://linuxtechlab.com/mail-command-send-mail-from-terminal/

No comments:

Post a Comment