• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 648
  • Last Modified:

Setup Sendmail to Transmit Nightly Backup Log File

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
SqueezeOJ
Asked:
SqueezeOJ
  • 5
  • 2
1 Solution
 
droydenCommented:
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
 
arnoldCommented:
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
 
SqueezeOJAuthor Commented:
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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
arnoldCommented:
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
 
SqueezeOJAuthor Commented:
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
 
SqueezeOJAuthor Commented:
With the help of Google, I've got mutt working.

Have an example of a command-line mutt email?
0
 
SqueezeOJAuthor Commented:
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
 
SqueezeOJAuthor Commented:
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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now