Install mailutils with:
sudo apt-get install mailutils
Set up the cronjob with:
crontab -e
To send at 10 mins past the hour add:
10 * * * * sh /path/to/script
If you'll be emailing the same domain that your mailname is set to:
Navigate to /etc/postfix/
sudo vi main.cf
Find line beginning mydestination
, it should say something like:
mydestination = ubuntu, localhost.localdomain, localhost
Crucially it shouldn't contain your mailname or references to it, or your emails will be sent internally on the server.
@seenusankara replace $usep with $used.