only thing is logfiles folder always exist but sometime is empty
your script assume it does not exist, it does but when it is empty than top folder (joe, miha, sonny...) is also marked for delete.
My script does not assume logfiles folder does not exist. The script checks if it exists. If it does not, top folder is marked for deletion.
Now script will delete top folder if ANY of these is true:
1. logfiles folder does not exist.
2. logfiles folder exists, but does not have any LOG*.txt files. (Will delete top folder if other files exist)
3. logfiles folder exists, has one or more LOG*.txt files, and newest is older than age limit (days).
Please tell me if this is correct.