For the original posting:
>
> Hi all,
>
> I have the following system setup (uname -a):
>
> OSF1 holly.resptk.bhp.com.au V3.0 347 alpha
>
> 'cron' runs the following command which was the default setup when the
> system was installed:
>
> 20 4 * * * find /tmp -type f -atime +2 -exec rm -f {} \;
>
> Evey time this command is executed the following Mail message is sent to the
> 'root' account:
>
> >From root Sat Oct 7 04:20:01 1995
> Date: Sat, 7 Oct 1995 04:20:01 +1000
> From: system PRIVILEGED account <root>
> Apparently-To: root
>
> find: bad status-- /tmp/croutUSEaaakba
>
>
> *************************************************
> Cron: The previous message is the standard output
> and standard error of one of your cron commands.
>
> It appears the 'find' command is encountering a tempory file which is produced
> by the 'cron' when running the command.
>
> I am curious if anyone else has the same problem, as the 'root' mail will keep
> building up if you do not remove the mail messages.
>
> Should this happen or not ? Or is my setup wrong ?
>
> The easiest way around this would be to redirect the cron command to
/dev/null.
>
> Can anyone enlighten me
The following people replied:
"Tim W. Janes" <janes_at_signal.dra.hmg.gb>
jnolan_at_ibm.net
Michael Matthews <matthewm_at_sgate.com>
Phil Rand <prand_at_paul.spu.edu>
"Gary W. Perkins" <perkins_at_uscolo.edu>
"Dr. Tom Blinn, 603-881-0646" <tpb_at_zk3.dec.com>
Several people responded saying they have the same problem. Several responses
suggested the problem occurs when two cron jobs are executed at the same time
and the cron job "20 4 * * * find /tmp -type f -atime +2 -exec rm -f {} \;"
is attempting to remove a 'cron log' file from the other cron job or maybe
itself. I set off two cron jobs to occur every minute,
0-59 * * * * find /tmp -type f -atime +2 -exec rm -f {} \;
0-59 * * * * echo "Running Cron"
You end up with TWO mail messages, the expected one saying "Running Cron" and
the one saying "find: bad status-- /tmp/croutUSEaaakba".
The solution would be to change cron jobs running at the same time as the
clean up cron job which is installed at installation time. If thats not possible
redirect 'stdout & stderr' of the cron job '/dev/null' or '/dev/console' such as
20 4 * * * find /tmp -type f -atime +2 -exec rm -f {} \; 2>&1 >/dev/null
Thanks for all Help.
Joe
joe_at_resptk.bhp.com.au
Received on Tue Oct 10 1995 - 06:08:03 NZDT