View Full Version : How to email
LowSky
August 8th, 2010, 05:17 PM
Maybe someone can help me with this.
I want my PC to email the results of running a command like lsusb every 24 hours. How would I go setting this up?
TIA
Bachstelze
August 8th, 2010, 05:27 PM
command | mail -s Subject foo@bar.org
Put that in a cron job, either directly or in a shell script if you want to so something more complex.
LowSky
August 8th, 2010, 08:46 PM
Thanks Bachstelze I'm going to try that out
Bachstelze
August 8th, 2010, 08:48 PM
Thanks Bachstelze I'm going to try that out
Your system must be properly configured to send email, though. If you want a quick and easy way, use ssmtp and configure it to use the SMTP server of your ISP.
LowSky
August 8th, 2010, 09:46 PM
Very cool! I got it to work! Thanks for tips
Installed ssmtp, then created a simple cron job that looks like this
MAILTO=xxxxxxx@gmail.com
00 10 * * * mythtv-status
Now I get an email that will tell me what is being recorded for the day.
Powered by vBulletin® Version 4.2.2 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.