This is slightly different question/variation to this question
- Remove all directories whose created on time is older than N days.
- Don't consider the sub-directories/files within the directory.
Ex:
drwxrwxr-x 6 test test 4096 Aug 26 14:42 2.1.6-SNAPSHOT_201408261440_1
drwxrwxr-x 6 test test 4096 Sep 1 05:13 2.1.6-SNAPSHOT_201408281233_1
drwxrwxr-x 6 test test 4096 Sep 1 10:06 2.1.6-SNAPSHOT_201409011001_1
drwxrwxr-x 6 test test 4096 Sep 1 15:58 2.1.6-SNAPSHOT_201409011554_1
drwxrwxr-x 6 test test 4096 Sep 2 15:11 2.2.0-SNAPSHOT_201409021508_1
drwxrwxr-x 6 test test 4096 Sep 2 15:18 2.2.0-SNAPSHOT_201409021515_1
drwxrwxr-x 6 test test 4096 Sep 5 13:05 2.2.0-SNAPSHOT_201409051303_1
drwxrwxr-x 6 test test 4096 Sep 5 15:32 2.1.6-SNAPSHOT_201409051528_1
drwxrwxr-x 6 test test 4096 Sep 8 11:54 2.1.6-SNAPSHOT_201409081152_1
I should be able to delete all folders in this path whose created on is older than N days. The inside folder might have updated files/sub-directories which are new, it doesn't matter.