From: Jeffrey Morse <jmorse@m4cc.com>
To: Mark Shadley <mark@shadley.us>
Cc: linux-admin@vger.kernel.org
Subject: Re: output from unnatended bash shell scripts
Date: Fri, 5 Mar 2004 16:38:02 -0600 [thread overview]
Message-ID: <20040305223801.GC19880@m4cc.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0403051254250.2729@znvy.funq.ubzr>
Here is a very simple scirpt I wrote that checks for mail relaying
attempts against one of my mail servers, the output of the script is
piped to root and roots mail is directed to me via the aliases file.
The script is run daily by cron.
Hope this helps.
-jeff
-----start script-----
#!/usr/bin/perl -w
# Run this script daily to check
# for relaying attempts made against
# mail server and mail the results
# to root
use strict;
my $log = "/var/log/maillog";
system( "egrep -i denied $log |mail -s \"mail-relaying `date`\"root");
-----end script------
* On [03-05-2004 12:56 -0800] Mark Shadley <mark@shadley.us> wrote:
> Hi,
>
> Thanks for the suggestion. I did that.
>
> The problem is that the program output is not displayed in the emails
> *only* when run from cron. I get the emails, they are mostly empty.
>
> Thanks again.
>
> Mark Shadley
>
>
> On Fri, 5 Mar 2004, Matt Hemingway wrote:
> >
> > Try putting MAILTO:user@domain.com above the entry in the cron(tab) file.
> >
> > -Matt
> >
> > On Fri, 5 Mar 2004 12:47:44 -0800 (PST)
> > Mark Shadley <mark@shadley.us> wrote:
> >
> > > Hi,
> > >
> > > I have forgotten how to get the output from unnatended bash shell scripts
> > > (run from crond) to show up in email. I get the emails, but they don't
> > > have all the output of the programs. If I run the scripts manually, I get
> > > all of the output in the emails.
> > >
> > > I appreciate any help offered.
> > >
> > > Thanks in advance.
> > >
> > > Mark Shadley
> > > -
> > > To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > >
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
>
next prev parent reply other threads:[~2004-03-05 22:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-05 20:47 output from unnatended bash shell scripts Mark Shadley
2004-03-05 20:52 ` Matt Hemingway
2004-03-05 20:56 ` Mark Shadley
2004-03-05 22:38 ` Jeffrey Morse [this message]
2004-03-05 22:59 ` Joakim Ryden
2004-03-05 20:56 ` Matías López Bergero
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040305223801.GC19880@m4cc.com \
--to=jmorse@m4cc.com \
--cc=linux-admin@vger.kernel.org \
--cc=mark@shadley.us \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).