* output from unnatended bash shell scripts
@ 2004-03-05 20:47 Mark Shadley
2004-03-05 20:52 ` Matt Hemingway
2004-03-05 20:56 ` Matías López Bergero
0 siblings, 2 replies; 6+ messages in thread
From: Mark Shadley @ 2004-03-05 20:47 UTC (permalink / raw)
To: linux-admin
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: output from unnatended bash shell scripts
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 20:56 ` Matías López Bergero
1 sibling, 1 reply; 6+ messages in thread
From: Matt Hemingway @ 2004-03-05 20:52 UTC (permalink / raw)
To: Mark Shadley; +Cc: linux-admin
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
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: output from unnatended bash shell scripts
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 ` Matías López Bergero
1 sibling, 0 replies; 6+ messages in thread
From: Matías López Bergero @ 2004-03-05 20:56 UTC (permalink / raw)
To: Mark Shadley; +Cc: linux-admin
command 2>&1
This mix the error output with the standart output.
Regards!
Matías.
Mark Shadley 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: output from unnatended bash shell scripts
2004-03-05 20:52 ` Matt Hemingway
@ 2004-03-05 20:56 ` Mark Shadley
2004-03-05 22:38 ` Jeffrey Morse
0 siblings, 1 reply; 6+ messages in thread
From: Mark Shadley @ 2004-03-05 20:56 UTC (permalink / raw)
To: Matt Hemingway; +Cc: linux-admin
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
>
--
Mark Shadley, Proprietor
Shad.Net Consulting
16542 E. Masline St.
Covina, CA. 91722-1133
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: output from unnatended bash shell scripts
2004-03-05 20:56 ` Mark Shadley
@ 2004-03-05 22:38 ` Jeffrey Morse
2004-03-05 22:59 ` Joakim Ryden
0 siblings, 1 reply; 6+ messages in thread
From: Jeffrey Morse @ 2004-03-05 22:38 UTC (permalink / raw)
To: Mark Shadley; +Cc: linux-admin
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
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: output from unnatended bash shell scripts
2004-03-05 22:38 ` Jeffrey Morse
@ 2004-03-05 22:59 ` Joakim Ryden
0 siblings, 0 replies; 6+ messages in thread
From: Joakim Ryden @ 2004-03-05 22:59 UTC (permalink / raw)
To: linux-admin
Yikes - that looks like some major overkill. :)
How about a cron entry such as...
* * * * * /usr/bin/egrep -i denied /var/log/maillog | /usr/bin/mail -s
"mail-relaying `date`" root
?
--Jo
On Friday 05 March 2004 02:38 pm, Jeffrey Morse wrote:
> 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------
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-03-05 22:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2004-03-05 22:59 ` Joakim Ryden
2004-03-05 20:56 ` Matías López Bergero
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).