find: `/path/to/logdir/log1/aaaaaa.log': No such file or directory

Solution Unverified - Updated -

Issue

  • We run a script which includes the following find command.
find /path/to/logdir/* -prune -name 'log*' -type d -exec rm -rf {} \;
  • Then, we experienced the following error once.
find: `/path/to/logdir/log1/aaaaaa.log': No such file or directory
  • We have another process which creates/remove the above aaaaaa.log.
  • We expect to remove /path/to/logdir/log* directory by the find command, how can we avoid the above error?

Environment

  • Red Hat Enterprise Linux

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content