Rotating freeradius log
Trond Endrestøl
Trond.Endrestol at fagskolen.gjovik.no
Wed Jan 14 10:19:27 UTC 2015
On Wed, 14 Jan 2015 16:49+0700, Olivier Nicole wrote:
> Hi,
>
> Is there a way to use newsyslog to rotate freeradius accounting logs?
>
> Freeradius creates accounting logs of the form
> /var/log/radacct/IP-ADDRESS/reply-detail-DATE and
> /var/log/radacct/IP-ADDRESS/auth-detail-DATE
>
> Is there a way to configure newsyslog to remove the files that are older
> than X days?
>
> /var/log/radacct/*/* is not working in /etc/newsyslog.conf
How about creating an entry in /etc/crontab, executing:
/usr/bin/find /var/log/radacct -mtime 7d -delete
The example above deletes everything older than 7 days. See find(1)
for more information, the documentation for the -mtime option refers
to the documentation for -atime option.
We can refine the example to only cover (ordinary) files:
/usr/bin/find /var/log/radacct -type f -mtime 7d -delete
--
+-------------------------------+------------------------------------+
| Vennlig hilsen, | Best regards, |
| Trond Endrestøl, | Trond Endrestøl, |
| IT-ansvarlig, | System administrator, |
| Fagskolen Innlandet, | Gjøvik Technical College, Norway, |
| tlf. mob. 952 62 567, | Cellular...: +47 952 62 567, |
| sentralbord 61 14 54 00. | Switchboard: +47 61 14 54 00. |
+-------------------------------+------------------------------------+
More information about the freebsd-questions
mailing list