Solved

Cron to send e-mail

Posted on 1999-01-20
2
201 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
error log using ftp 7 83
bash file 10 68
Upgrade BIOS / EUFI at Scale 4 71
HOw To Install Docker on VMware Workstation 19 355
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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 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.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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