2021-01-08 19:13:29 +00:00
Install
=======
Install `msmtp` package:
sudo apt install msmtp
Configuration, see [ubuntu-rf.org ](https://doc.ubuntu-fr.org/tutoriel/comment_envoyer_un_mail_par_smtp_en_ligne_de_commande )
Use
===
To add it to the cron tab:
2021-12-15 10:48:01 +00:00
sudo /etc/crontab
2021-01-08 19:13:29 +00:00
2021-12-15 10:48:01 +00:00
The add new line (to run the check once per hour), don't forget to change the username:
2021-01-08 19:13:29 +00:00
2021-12-15 10:48:01 +00:00
1 * * * * username /home/caracals/outils/warn-if-broken-url/warn-if-broken-url.sh > /dev/null 2>& 1
2021-01-08 19:13:29 +00:00
**Note:**
- Normaly cron send task outputs (echo) via mail. As the MTA (Mail Transfert Agent), may not be set up,
the crontab line redirect the outputs into `/dev/null` .
2021-12-15 10:48:01 +00:00
- Sudo is needed to update the crontab. It also possible to set up your user crontab with `crontab -e` . In this case, remove `username` from the cron entry.
2021-01-08 19:13:29 +00:00
- The logs can be seen using (with sudo): `sudo grep CRON /var/log/syslog`