Find dont exclude folder

  • Thread starter Thread starter postcd
  • Start date Start date
P

postcd

Guest
in my bash script i have this command:

/bin/nice -n 19 /usr/bin/ionice -c2 -n7 find $wheretosearch -type f -size -800k -mmin -1440 ! -path "*backup*" ! -path "*/sys/*" ! -path "*/usr*" ! -path "*/proc/*" ! -path "*/task/*" -exec grep -l "$phrasse" {} \; >> $outputfile

as you see im trying to exclude folders like "proc" and "task" from the search, but when i execute script, it returns things like:

find: /vz/root/240/proc/15889/task/15976: No such file or directory
find: /vz/root/240/proc/15889/task/16070: No such file or directory
find: /vz/root/240/proc/15889/task/16092: No such file or directory
find: /vz/root/240/proc/15889/task/16105: No such file or directory
find: /vz/root/1140/proc/1/task/1: No such file or directory
find: /vz/root/1140/proc/1170/task/1170: No such file or directory
find: /vz/root/1140/proc/1437/task/1437: No such file or directory

But when i exclude "sys" folder same way as proc, it woks to be excluded, but proc still showup

so im asking what is wrong on that command? thx
 


Staff online

Members online


Top