Re: help needed to setup logrotate
> I been trying to get syslog or logrotate to do the job but no luck yet.
> In the dir /etc/logrotate.d I added the file bttrack and in that file I
> placed the lines :
>
> /var/log/bttrack.log {
> rotate 7
> daily
> monthly
^^^^^^^ I think your problem is here. The monthly directive
overrides the daily directive.
> compress
> missingok
> }
Hi Justin,
I have now redited the file to:
/var/log/bttrack.log {
rotate 7
daily
compress
missingok
}
and run the command : sudo savelog -t bttrack.log
sevral times and it as produced :
bttrack.log
bttrack.log.0
bttrack.log.1.gz
bttrack.log.2.gz
bttrack.log.3.gz
bttrack.log.4.gz
bttrack.log.5.gz
bttrack.log.6.gz
Now I have deleted the log files from bttrack.log.0 to bttrack.log.6.gz
and I will wait and see what the daily cron dose at 06:26. As you pointed out
it will be the monthly directive overrides the daily directive I bet.
Bingo at 06:26 logrotate produced " bttrack.log.1.gz "
So it looks like the problem have been solved.
Thanks Justin for pointing the config error out.
Regards
peter colton
Reply to: