find: `/path/to/logdir/log1/aaaaaa.log': No such file or directory
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.