853 B
853 B
Install
Install msmtp
package:
sudo apt install msmtp
Configuration, see ubuntu-rf.org
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, removeusername
from the cron entry. - The logs can be seen using (with sudo):
sudo grep CRON /var/log/syslog