Script to Email File to FreeNAS User

Status
Not open for further replies.

nello

Patron
Joined
Dec 30, 2012
Messages
351
I have a bash script that does some post processing on files that MythTV records. Under some circumstances I'd like the script to email the contents of a log file to the address listed in System > Email

I presume that I should use the mail command something like this:
Code:
#!/bin/bash
file=file_to_check
if[-s ${file}];then
mail -s "Email Subject" root < $file
fi


The script executes without error ... but the mail message doesn't arrive at the email address specified in System > Email

Can anyone give me a hint on what I'm doing wrong in this script?

Thank you.

- nello
 
Last edited:
Status
Not open for further replies.
Top