Solved

Cron to send e-mail

Posted on 1999-01-20
2
197 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
ID: 1639213
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
ID: 1639214
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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.

943 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

10 Experts available now in Live!

Get 1:1 Help Now