Article 4WSZM Find missing filenames from a list recursively

Find missing filenames from a list recursively

by
qombi
from LinuxQuestions.org on (#4WSZM)
Hello,

I have researched how to find missing filenames from a list recursively and I am close but not there completely.

I have files on one server that I need to verify exist on another server. I first made a list of the files with Code:ls > filelist on one server. Copied that list to the other server for auditing.

I then executed script on server to be audited:

Code:while IFS= read -r name; do
[ -n "$(find / -name "$name" -print | head -n 1)" ] || printf '%s\n' "$name"
done < filelistThis printed out a list of missing files to the screen which was partially correct. The issue is files with special characters and spaces in their names. They show as missing. If I manually change files such as Code:[this] file name to Code:\[this\]\ file\ name, then it works properly. I tried Code:' ' or Code:" " but that didn't seem to work.

How do I print a list of filenames from the originating server that contain the backslashes in files for special characters and spaces? I found Code:ls -b but that only shows Code:\ for the spaces not special characters.

Or is there a better way of doing this all together? Thankslatest?d=yIl2AUoC8zA latest?i=9iS2xAj9B-g:1cbMH_qqOF8:F7zBnMy latest?i=9iS2xAj9B-g:1cbMH_qqOF8:V_sGLiP latest?d=qj6IDK7rITs latest?i=9iS2xAj9B-g:1cbMH_qqOF8:gIN9vFw9iS2xAj9B-g
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments