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:
This command is listing all directories named '2015' under /domains.
ButiI need something like that, searching only in the [domain]/errorlog, rule out the accidental matching for other "-name" directories:
OR
Thanks a lot, Regards!
Vas
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
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