I am trying to find reason behind this happening and also a solution .
When I try to run below command on Unix directory which has around 16 files and also one of the application process which keeps removing or renaming the files from this same directory. The issue happens when I invoke the command and at the same time one or more files are moved from this location by the application process running.
ls -al |wc -l
ls: 'file_which_has_removed.txt': No such file or directory
I also find same issue while firing find command.
find . -maxdepth 1 -atime +15
/bin/find: '/u1/bruce/File_removed.txt': No such file or directory
The solution ism trying to find is , I s there any way we can avoid this error, _ want to run this find command and then use -delete to remove these old files from directory without stopping the application process.
man find
has an option specifically for this; forls
you could pipe stederr to /dev/null