Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jun 1999 09:28:00 +0300
From:      Ruslan Ermilov <ru@ucb.crimea.ua>
To:        Scott Worthington <SWorthington@hsag.com>
Cc:        freebsd-questions@FreeBSD.ORG, wmptl@MNSi.Net
Subject:   Re: cron difficulties
Message-ID:  <19990625092800.C5584@relay.ucb.crimea.ua>
In-Reply-To: <s7723d69.065@internal.hsag.com>; from Scott Worthington on Thu, Jun 24, 1999 at 02:14:34PM -0700
References:  <s7723d69.065@internal.hsag.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jun 24, 1999 at 02:14:34PM -0700, Scott Worthington wrote:
> Alright, Nathan... I'm not sure that anyone has really helped you with
> your cron problem.
> 
> Here's what is going on (and how to solve the problem):
> 
> Your cron'ed software is generating output, there are two kinds:
> standard output
> standard error
> 
> This is controlled by your shell.  To learn more, type 'man sh'
> Press the '/' key and type in standard error.
> 
> Okay, here's the problem with your cron:
> You are going to redirect the standard out AND standard error to the
> device null.
> 
> nameofcommand 2>&1 > /dev/null
> 
It's better to write ``nameofcommand >/dev/null 2>&1'' instead.

> 'nameofcommand' is the command that you want run
> 2>&1 tell the shell that both the standard error and standard output
> are going to be redirected (NOT PIPED) to the device /dev/null
> which 'throws the data into the bit bucket--bye'.
> 
> Let us know your results.
> 
[...]

> If anyone out there knows how turn off the mail feature of cron altogether
> that would be nice, if not for just the cron jobs that are causing
> annoyances, a copy of the /etc/crontab follows appends this note.
> 
According to crontab(5) manpage:
} If MAILTO is defined (and non-empty), mail is sent to the user so named.
} If MAILTO is defined but empty (MAILTO=""), no mail will be sent.
                                              ^^^^^^^^^^^^^^^^^^^^
} Otherwise mail is sent to the owner of the crontab.


Cheers,
-- 
Ruslan Ermilov		Sysadmin and DBA of the
ru@ucb.crimea.ua	United Commercial Bank,
ru@FreeBSD.org		FreeBSD committer,
+380.652.247.647	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990625092800.C5584>