Solved

Cron to send e-mail

Posted on 1999-01-20
2
195 Views
Last Modified: 2010-04-20
I need to run a cron job that will mail a .txt file to a group of folks on Monday each week.
I run Linux 5.2. I've tried several crons' but no luck.
I know it's simple, but I'm stumped..!
Any help would be appreciated.
Thanks,
Pote
0
Comment
Question by:pote
2 Comments
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
assuming your mail program is  /bin/mail (and it is BSD-style):

59 23 * * Mon /bin/cat file.txt | /bin/mail -s"subject" user@domain.name
0
 
LVL 7

Accepted Solution

by:
HalldorG earned 150 total points
Comment Utility
Use a script like
#!/bin/sh
/usr/lib/sendmail mailinglist  <<EOF
Subject: the mail every day
From: reply@mydomain.com
To: Mailinglist@mydomain.com

$(cat thetextfile)
EOF
-----------------
And the cron times are the same as abow.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

762 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

6 Experts available now in Live!

Get 1:1 Help Now