We set up msmtp and mutt, and we'll use these tools to be able to send mail notifications from Cron (sheduled task) trought a simple script :
we launch kate :
We'll paste this command below
mutt -s "k-tux test" firstname.lastname@example.org < /home/polux/Documents/test.txt
we'll save this script to /home/polux/Documents/muttscrip.sh (muttscrip.sh is the file name)
In order to make this script possible to be run, here is the command to tip in the "Documents" folder :
chmod +x muttscrip.sh
The script is ready !
It could be launched with the command below in the same folder :
We'll open crontab , tip this:
It's better to choose nano as text editor, we'll create our first sheduled task,
do "ctrl+o" and we'll tip it on the bottom "55 9..."
# m h dom mon dow command
55 9 * * * /home/polux/Documents/muttscrip.sh
m = minute
dom = month day
mon = month of the year
dow = day of the week ( 1 to 7 )
/home/polux/Documents/muttscrip.sh = script path
We'll leave and save crontab with "ctrl+x", and "y",and "enter"
It is possible to check crontab with this command
A mail should be sentat 9.55 !