I ended up writing the following shell script to identify the folders with no OPF metadata file.
Code:
#!/bin/bash
L=""
r="/Volumes/Ext/CalibreLibrary/"
d=$(find "$r" -type d -mindepth 2 -maxdepth 2)
while read p
do
o=$(find "$p" -name *.opf)
if [ -z "$o" ]
then
L="$L"$'\n'"$p"
fi
done <<< "$d"
echo "$L" > "/Users/wladdy/Desktop/opfless"
Once I was convinced that I had identified the proper folders, I ran another script to delete them:
Code:
#!/bin/bash
L="/Users/wladdy/Desktop/opfless"
while read p
do
rm -r "$p"
done < $L
I include the scripts because I am a very novice Bash scripter, and I would be grateful for any comments to make my code less clumsy (I am sure that there must be a more direct identification approach, using just a 'find' command and no loops...)
However, these work well enough as that are. O course, any Mac user interested is welcome to them (just be sure to adapt the pathnames to your own system).
Thanks again to BetterRed, who made me realize that the generation of the opf metadate files continues in the background way after the import has finished. Actually, I think that what cause my problems was quitting Calibre and disconnecting the external drive containing my library before the job had ended. Maybe a future version of Calibre could include a warning to neither quit nor eject while the library is being worked on in the background.
Anyway, problem solved! Onward to fresh ones...