Echo Missing Files From Partition
I'm trying to clean up my samba share and need to echo out the files which are missing from the directory recursively. If it finds the file from the list it simply echo's the path. If it doesn't find it from the path then it echo's out the missing file. So far I have this but can't seem to get the logic right. Can anyone help point me in the right direction?
for FILE in `cat list`; do
if [ ! -z `find /opt -name $FILE` ];
then
echo "File $FILE does not exists"
else
echo "$FILE exists"
fi
done
|
Recent comments
1 day 5 min ago
1 day 10 min ago
1 day 5 hours ago
1 day 11 hours ago
1 day 12 hours ago
1 day 13 hours ago
1 day 18 hours ago
2 days 51 min ago
2 days 4 hours ago
2 days 6 hours ago