I know there is "find" and I use something like find "/backup.stats/30days" -mtime +30 -type f But I wanted to know if anyone knew of a way to pick out the oldest file by month; not all months are 30 days long and I only want to be able to find and copy the oldest file by month.
For example if there was a file created march 31st at 11:59PM, copy it out somewhere. But if for some reason the oldest that month was march 30th at 2:30am, copy it out.
The idea is I have a folder with the last 30 days of stats for a home network and I want to make sure I have at least one copy saved for each month in a different folder.
Does anyone have any ideas?
EDIT: as pointed out in the comments below. I actually meant the file that would have the stats for the whole month. So it would be the newest file made when the month rolls over.