I have two directories which have some files since 20019.
Now I need to make a glob which collects only the files from the last 6 months.
I have tried to use this functions but I haven't found a way to get the sequence for the month and year from month X to current Month via year change.
logger.info("getYear {}", LocalDate.now().minusMonths(6).getYear());
logger.info("last 6 month log7177/log-{}-{}",
LocalDate.now().minusMonths(6).getYear(),
LocalDate.now().minusMonths(6).getMonthValue());
the Shell pattern looks like this
ls -la log7177/log-2022-{09,10,11}* log7177/log-2023-{01,02,03}*
Any hint into the right direction is really appreciated.