30 lines
853 B
Markdown
30 lines
853 B
Markdown
|
|
|
|
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:
|
|
|
|
sudo /etc/crontab
|
|
|
|
The add new line (to run the check once per hour), don't forget to change the username:
|
|
|
|
1 * * * * username /home/caracals/outils/warn-if-broken-url/warn-if-broken-url.sh > /dev/null 2>&1
|
|
|
|
|
|
**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`.
|
|
- 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.
|
|
- The logs can be seen using (with sudo): `sudo grep CRON /var/log/syslog`
|