output from unnatended bash shell scripts

output from unnatended bash shell scripts

am 05.03.2004 21:47:44 von Mark Shadley

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

Re: output from unnatended bash shell scripts

am 05.03.2004 21:52:53 von Matt Hemingway

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 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

Re: output from unnatended bash shell scripts

am 05.03.2004 21:56:24 von mlopezb

command 2>&1

This mix the error output with the standart output.

Regards!
Mat=EDas.


Mark Shadley wrote:
> Hi,
>=20
> I have forgotten how to get the output from unnatended bash shell scr=
ipts
> (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.
>=20
> I appreciate any help offered.
>=20
> Thanks in advance.
>=20
> 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
>=20

-
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

Re: output from unnatended bash shell scripts

am 05.03.2004 21:56:59 von Mark Shadley

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 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

-
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

Re: output from unnatended bash shell scripts

am 05.03.2004 23:38:02 von Jeffrey Morse

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 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 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
> >
>
-
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

Re: output from unnatended bash shell scripts

am 05.03.2004 23:59:16 von Joakim Ryden

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------
-
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