find /path/to/directory -type f -mtime 61 -exec rm -f {} \; 61 (days) works for everyting except it is one day short for July August and 1 to two days long for (January/February) / (February/March).
Edit: make it 62 if it absolutely must be every last day for two months. Retaining too much is usually better than retaining too little.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,484
Solved Threads: 494
Skill Endorsements: 17
The exec portion of the find command must be ended with the two literal characters \; And before this you must provide the argument to ls. The argument is the file found and you pass it the command with the two literal characters {} So your complete command will be find -type f -mtime 61 -exec ls -ltr {} \;
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,484
Solved Threads: 494
Skill Endorsements: 17
Change the 61 to +61 for all files more than 61 days old or to -61 for all files less than 61 days old (Both not including exactly 61 days old). 61 (without a + or -) means eactly 61 days old.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,484
Solved Threads: 494
Skill Endorsements: 17