Something you might consider adding to the script, is to ensure that all directories are accessible to minidlna
Some (most) subdirectories were not added during a scan, so I downloaded the minidlna source code, and found that
a directory is scanned if the condition below is true:
if( (type == TYPE_DIR) && (access(full_path, R_OK|X_OK) == 0) )
I.E: it is a directory, and the permissions are OK.
I checked, and realized that those directories, I had created using rsync to an NFS mount
from another machine, was only accessible by the owner of the directory, I.E: me, and not by minidlna.
The directories that scanned OK, was manually created by me, after ssh'ing in.
ls ld mydir would print out
software# ls -ld A
drwx------ 2 ulf wheel 44 May 5 09:31 A
so I fixed this:
software# chmod 777 A
software# ls -ld A
drwxrwxrwx 2 ulf wheel 44 May 5 09:31 A
and now the directory "A" can be found.