LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Server Email (https://www.linuxquestions.org/questions/linux-newbie-8/server-email-656727/)

RAH104 07-18-2008 05:16 PM

Server Email
 
Hello,

I would like to receive a regular email containing results of the following commands:

locate *file*
nano *file*

Is this possible?

Thanks.

Mr. C. 07-18-2008 06:44 PM

Just piped the output to mail:

Code:

locate *file* | mail -s "Your subject.." user@example.com
Nano is an editor - what does it mean to email an edit session?

RAH104 07-18-2008 07:20 PM

That worked however the following isn't sending an email:

cat /home/freeunlimitedweb.com/runtime_layeredpanel/var/log/httpd/access_log.users | mail -s "Access Log" email@email.com

Mr. C. 07-18-2008 07:45 PM

Now it is time to look at your maillog in /var/log/maillog. Look for transactions at the time you sent the message.

You don't need to use cat - many programs read STDIN:

Code:

mail -s "Access Log" email@email.com /home/freeunlimitedweb.com/.../access_log.users


All times are GMT -5. The time now is 03:50 AM.