Searching issue

Hi everybody!
First up, sorry for my bad English.
I don't found a simply way to collect the Apache errorlog's old directories...
I have FreeBSD 9.1 with Bash.

The Apache error logs are within each domain directory (for the users):

/domains/[domain]/errorlog/[YEAR]/[month]/[day]

I need a command for listing all directory named '2015' or so, for delete in the future.
I don't know what is the right method for searching recursively in the directory structure.
I'm trying this, but it won't work well:

find /domains - type d ! -newermt 2016-01-01 -name '2015' -print

This command is listing all directories named '2015' under /domains.
But iI need something like that, searching only in the [domain]/errorlog, rule out the accidental matching for other "-name" directories:

find /domains/*/errorlog - type d ! -newermt 2016-01-01 -name '2015' -print
OR
find /domains - type d ! -newermt 2016-01-01 -name 'errorlog/2015' -print

Thanks a lot, Regards!

Vas
 
Thanks for the reply!
I don't know what I need to use :)
ls is not good, because it gives back the directories contents, by the way it won't works :(

Code:
[root@polymix /home/polymix]# ls -d /domains/*/errorlog/2015
ls: /domains/*/errorlog/2015: No such file or directory

I need the directories for delete and recursively...
 
Back
Top