Sending system reports via e-mail
To wrap up this chapter, we'll work through an example of having the system e-mail you information at various intervals. This is very useful if you want to be updated periodically about any specific resource, such as installed packages or even backups. In our example, we're going to set up a report that will contain a list of all the packages installed on our system.
In order to create e-mail alerts, you first need an e-mail account from which you can send the alert. It's recommended that you do not use your personal e-mail account when dealing with scripts. Instead, either create an e-mail account for this purpose, or if you work in a corporate environment, ask the e-mail administrator to set you up with an alert account to use. Next, you'll need the sendEmail package installed, so let's take care of this with the following command:
sudo apt-get install sendemail
The sendEmail
utility runs in the shell, so you won't see it in...