From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96075324106518.tru64-unix-managers.marc@archive.invalid> From: joe () resptk ! bhp ! com ! au Date: Tue, 10 Oct 1995 04:38:56 +0000 To: tru64-unix-managers Subject: SUMMARY : CRON & Find keep giving bad status mail messages X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96075324106518 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 > 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" jnolan@ibm.net Michael Matthews Phil Rand "Gary W. Perkins" "Dr. Tom Blinn, 603-881-0646" 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@resptk.bhp.com.au