We need to analyze all of the data in it once per month and therefore have only the last month's data in it. In other words, today is 01MAY2020 and I want to have only May's data in the logfile so that in June when I inspect/analyze/evaluate the data I can be certain that it ONLY HAS dates for May in it.
So, my coworker setup a logrotate policy in /etc/logrotate.d, called ETA:
The policy syntax looks like the following:
Code: Select all
/var/log/ETA.log {
rotate 3
missingok
monthly
dateyesterday
delaycompress
compress
copytruncate
}
Code: Select all
logrotate -f /etc/logrotate.d/ETA
Code: Select all
NOTE: The syntax above has been updated today with "dateyesterday" and "delaycompress" because I want last month's date on the file instead, and not to compress the file until the next month over.
The problem is that the data in it includes data from today, 01MAY2020 all the way through "Fri May 1 03:15:01 EDT 2020"
We just want, for example, data from 01JUN2020 00:00:00 through 31JUN2020 23:59:59, to be in the rolled logfile for June, since we cannot fix it for May already. friberibitz!
I don't know how to force the logrotation of my specific file, to occur on the first day at 00:00:00 each month. Any ideas would be greatly welcomed, and maybe if they involve the /etc/anacrontab with some adjustments that would be fine; even if they don't they would be welcomed also.