Solved

Setup Sendmail to Transmit Nightly Backup Log File

Posted on 2011-02-27
8
636 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 77

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 77

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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
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é.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

910 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

20 Experts available now in Live!

Get 1:1 Help Now