Solved

Setup Sendmail to Transmit Nightly Backup Log File

Posted on 2011-02-27
8
635 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
  • 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 76

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
 
LVL 76

Accepted Solution

by:
arnold earned 500 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now