[ILUG] cron strangeness

Niall O Broin niall at linux.ie
Sat Aug 19 11:10:31 IST 2006


I have a cron job running hourly on a production server which tidies  
various things up - removes old temporary files, purges old sessions  
etc. One line in this file is:

find /tmp -name \*.incoming -mmin  +1200 -exec rm -fr {} \;

as a result of which, I now and then get emails like this

> Subject: Cron <root at blah.com>    run-parts --report /etc/cron.hourly
>
> /etc/cron.hourly/cleanup:
> find: /tmp/10882.incoming: No such file or directory

This just SHOULD not be happening. The process which creates /tmp/ 
10882.incoming should have erased it, but sometimes doesn't, and 20  
hours later has long ceased to care about it. So, when find finds the  
directory, it should be able to deal with it.

Instead, what seems to be happening is that find does indeed find the  
directory, but when it tries to rm it, it can't do so, because it's  
no longer there. But for the life of me, I can't imagine what is  
removing the directory between the time find finds it, and when it  
tries to remove it (a rather small window).


Any wild ideas?


Niall





More information about the ILUG mailing list