If you want to use
find to delete only regular files and no directories, then make absolutely sure that you use
-type f. This will prevent pathnames that refer to directories (or anything that is not a regular file) to be processed. The directories got deleted since their last modified timestamp fulfilled the criteria for deletion.
Also, if you are deleting files, don't use
rm -r since recursing into a regular file does not make sense. With most
find implementations you can also choose to use
-delete rather than
-name "*" is a no-op and could be removed since every name matches
If you run find over
/log/dir, then you don't need to run it on
/log/dir/tmp as the latter will be processed as part of the former. If you intend to only look in these two directories, but not in subdirectories, add
-maxdepth 1 to
find (if it supports it), and in that case, you do need to process them separately (but this may be done in one
find invocation as the utility takes any number of top-directories).
Suggestion, depending on what it is you want to achieve:
find /log/dir /log/dir/tmp -maxdepth 1 -type f -mtime +7 -delete
mtime of a directory is updated when a file is added or deleted from the directory. It is therefore unclear whether your attempts to delete directories based on the last modified timestamp is a good idea to start with.
For rotation of log files, you may also look into using
logrotate or some similar utility, from a cron job.