Facing abnormality in Find command


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Facing abnormality in Find command
# 1  
Old 06-10-2019
Facing abnormality in Find command

Whenever the below command is being executed by a scheduler at UNIX environment, we are getting below error
Code:
cd /tmp/log
find . -ignore_readdir_race ! -name . -prune -iname 'XYZ*' -type f -mtime +4 -printf "%f\n"
./tmpfile.script_name.2.31885.201906071336.tmp': No such file or directory
./tmpfile.script_name.1.31885.201906071336.tmp': No such file or directory
./tmpfile.script_name.1.31869.201906071336.tmp': No such file or directory
./tmpfile.script_name.1.31879.201906071336.tmp': No such file or directory
./tmpfile.script_name.2.31869.201906071336.tmp': No such file or directory
./tmpfile.script_name.2.31879.201906071336.tmp': No such file or directory
Aborted after 00:00:14: ERROR listing files for XYZ* in /tmp/log

But interestingly XYZ* files are present in the current directory /tmp/log
what could be the reason behind the find command failing ?
This command was working pretty fine until our UNIX storage server was changed from one vendor to other

Last edited by rbatte1; 06-18-2019 at 09:19 AM..
# 2  
Old 06-10-2019
The files being found are deleted before the find finishes i guess.
Are you sure you are not running multiple scripts against those folders, altering content with each ?

As for the storage part, you would need metrics from operating system before and after the change.

Regards
Peasant.
# 3  
Old 06-10-2019
I am surprised that despite the -ignore_readdir_race option the find complains like this. Perhaps a bug?
It might do the job nevertheless.

Try to forge a good exit status with
Code:
find ... || exit 0

This is shell code that works if the scheduler invokes system().
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

I'm facing problem with rpm command, when running the command and appears this error:

exec(): 0509-036 Cannot load program /usr/opt/freeware/bin/rpm because of the following errors: 0509-022 Cannot load module /opt/freeware/lib/libintl.a(libintl.so.1). 0509-150 Dependent module /opt/freeware/lib/libiconv.a(shr4.o) could not be loaded. 0509-152 Member... (4 Replies)
Discussion started by: Ohmkar
4 Replies

2. Shell Programming and Scripting

Abnormality while piping tr command output to sed

i have a file seperated each line seperated by newline. For example alpha beta gamma i am trying to replace the newlines to "," but dont want , present at the end of the line so i am trying the below one liner . but not sure whats wrong but its not working cat myfile | tr -s '\n' ',' | sed... (9 Replies)
Discussion started by: chidori
9 Replies

3. Shell Programming and Scripting

How to use grep & find command to find references to a particular file

Hi all , I'm new to unix I have a checked project , there exists a file called xxx.config . now my task is to find all the files in the checked out project which references to this xxx.config file. how do i use grep or find command . (2 Replies)
Discussion started by: Gangam
2 Replies

4. Shell Programming and Scripting

Problem facing command using shell

Dear Brothers! Need your help for the case where I am running one command on prompt and its giving us the correct output, but when i use the same command from shell its directs no output.:wall: the command on command prompt is ls -ltrh * | nawk '{if ($5~ '/$'M'/') print $9}' | grep -v... (1 Reply)
Discussion started by: jojo123
1 Replies

5. Linux

Simplified find command to find multiple file types

Hi, I'm using the following command to find the multiple requierd file types and its working fine find . -name "*.pl" -o -name "*.pm" -o -name "*.sql" -o -name "*.so" -o -name "*.sh" -o -name "*.java" -o -name "*.class" -o -name "*.jar" -o -name "*.gz" -o -name "*.Z" -type f Though... (2 Replies)
Discussion started by: vickramshetty
2 Replies

6. Shell Programming and Scripting

Problem facing in using awk command

Hi., I am not able to replace the string with another string using gsub fn of awk command. My code: awk 'BEGIN gsub(004,IND,004)' p.txt and my i/p file p.txt is of the format: av|004|adkf|Kent,004|s av|005|ssdf|Kd,IT park|s . . . and my desired o/p should be of : (13 Replies)
Discussion started by: av_vinay
13 Replies

7. UNIX for Dummies Questions & Answers

how to find a file named vijay in a directory using find command

I need to find whether there is a file named vijay is there or not in folder named "opt" .I tried "ls *|grep vijay" but it showed permission problem. so i need to use find command (6 Replies)
Discussion started by: amirthraj_12
6 Replies

8. Shell Programming and Scripting

Little bit weired : Find files in UNIX w/o using find or where command

Yes , I have to find a file in unix without using any find or where commands.Any pointers for the same would be very helpful as i am beginner in shell scritping and need a solution for the same. Thanks in advance. Regards Jatin Jain (10 Replies)
Discussion started by: jatin.jain
10 Replies

9. UNIX for Dummies Questions & Answers

facing problem with cut command

hi , i used ls -ltr | cut -f 1 > \dev\tty but all teh coulmns r getting printed instead of only one........how can i resolve this? prob 2 : wud be able start cutting from last field......supposing in the case of dyanmic list.i dunno the field number of last column.......so is... (3 Replies)
Discussion started by: vivekshankar
3 Replies

10. Shell Programming and Scripting

command find returned bash: /usr/bin/find: Argument list too long

Hello, I create a file touch 1201093003 fichcomp and inside a repertory (which hava a lot of files) I want to list all files created before this file : find *.* \! -maxdepth 1 - newer fichcomp but this command returned bash: /usr/bin/find: Argument list too long but i make a filter all... (1 Reply)
Discussion started by: yacsil
1 Replies
Login or Register to Ask a Question