Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

linux AT to send mail to another user

Posted on 2014-10-09
7
Medium Priority
?
403 Views
Last Modified: 2014-10-10
I use the  at  command to run a job. Since the user Patty has logged off, it automatically creates a mail to the user. The Patty never reads her mail. Is there a way to send the mail to another user instead? I know I can use the -M to suppress the mail, but someone else (penguin) still needs to know the job has run

Patty runs the command
at -f run_nightly_job now + 3 hours

user penguin needs to get the mail
0
Comment
Question by:penguins_rule
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 20

Expert Comment

by:n2fc
ID: 40370655
Pipe the output to mailx to send to multiple users...

Example:
at -f run_nightly_job now + 3 hours | mailx -s "Nightly Job" Patty Penguin

Note:
You MIGHT still need the -M flag to suppress a duplicate email to the submitter... Try it & see!
0
 
LVL 1

Author Comment

by:penguins_rule
ID: 40371070
Is there a way to get the contents of the original mail which has the results of the nightly job to be sent to Penguin?

Or a way to forward all mail from Patty to Penguin?
0
 
LVL 20

Expert Comment

by:n2fc
ID: 40371449
You can use a .forward file...

Check out the vacation command in your Linux manual...
0
What is a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

 
LVL 62

Expert Comment

by:gheist
ID: 40372308
Why dont you include "logger" command in your script and let interested read the log?
0
 
LVL 19

Accepted Solution

by:
NickUpson earned 2000 total points
ID: 40373124
you can add a line to /etc/aliases (don't forget to run newaliases afterwards) which sends all mail from Patty to Penguin

patty: penguin
0
 
LVL 1

Author Comment

by:penguins_rule
ID: 40373266
adding line in /etc/aliases gives me what i'm looking for.

Patty has an at which is scheduled for next Monday. Will the mail automatically go to penguin, or does the at command have to be killed and restarted?
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 40373346
as soon as the "newaliases" command is run, all email will be redirected
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

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

715 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