?
Solved

Setup Sendmail to Transmit Nightly Backup Log File

Posted on 2011-02-27
8
Medium Priority
?
645 Views
Last Modified: 2012-05-11
Hello,

I have a file server running Fedora 14.  

Every night this server runs a backup.  

I'd like to email the contents of a log file from the nightly backup to an external email address.

My server is not the mail server for my organization.  That mail server is not on-site.

How do I set up my file server to send me a transcript of a nightly job?

(Sendmail seemed like the way to do this, but I'd be happy to use another approach - as long as it works.)

Thanks!
0
Comment
Question by:SqueezeOJ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 7

Expert Comment

by:droyden
ID: 34992962
You just need to configure the smarthost in sendmail then use the mailx program and a crontab

cat path/to/log/file.log | mail -s "Backup Report" emailaddress@gmail.com

0
 
LVL 79

Expert Comment

by:arnold
ID: 34993122
Does your backup app have an option to generate an email on completion?
As long as you have a mail server installed/running sendmail, postfix, etc. and you configure them to use your ISP mail server, that is all that it takes.

it depends on the options available within the backup app as well.
0
 

Author Comment

by:SqueezeOJ
ID: 34993958
Hello,

Thanks or your responses...

droyden: I like your approach.  The code you gave me executes without error, but doesn't seem to actually send anything to me.  (I changed the command to have real information, of course.) You mention needing to configure the smarthost.  I haven't configured anything - it's a vanilla Fedora 14 install.  What should I be doing to configure it?

arnold:  I'm not using a backup app.  I simply need to copy the contents of one file and send it to my gmail account.

Jason
0
WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

 
LVL 79

Accepted Solution

by:
arnold earned 1500 total points
ID: 34994049
You can use a
(echo "To: <youremail address>
From: <email address>
Subject: email with data

Body of message";
cat <filename with data>
) | /usr/sbin/sendmail -t -oi

If you have mutt installed, I find it more preferrable if one has to use a mail client application versus the sendmail route as the example above has.
0
 

Author Comment

by:SqueezeOJ
ID: 34994114
Just installed mutt and now I have a tiny little email program.  Cool.

Can't seem to get it to send external email - probably needs to be set up.

How do I configure it to login to a distant mail server and send mail from there?
0
 

Author Comment

by:SqueezeOJ
ID: 34994151
With the help of Google, I've got mutt working.

Have an example of a command-line mutt email?
0
 

Author Comment

by:SqueezeOJ
ID: 34994194
THANKS!

Your mutt tip was just what I needed to figure this out.

Here's the command line I use to send email:

mutt -s "Test Mail" me@mycompany.com < ./Desktop/log.txt

Open in new window


Add -a switch plus file path to add an attachment.

I created the mutt configuration file based on http://www.andrews-corner.org/mutt.html

Jason
0
 

Author Closing Comment

by:SqueezeOJ
ID: 34994200
Your mutt tip pointed me in the right direction.  Once I had that I was able to google my way to success....but without your help, it would've taken me much longer!
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month9 days, 1 hour left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question