<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ramdyne (Posts about logrotate)</title><link>https://www.ramdyne.nl/</link><description></description><atom:link href="https://www.ramdyne.nl/categories/logrotate.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Sat, 07 Mar 2026 00:09:00 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Fun with logrotate and wildcards</title><link>https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/</link><dc:creator>ramdyne</dc:creator><description>&lt;p&gt;So a few months ago I found that freeradius on one of my machines was logging
all transactions in a daily log file. After a few years this accumulated to a
large number of files that started to gobble up too much disk space. Together with
a colleague I created the following logrotate:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_cbc6e85000674b0dbb18f95fca09a9ee-1" name="rest_code_cbc6e85000674b0dbb18f95fca09a9ee-1" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_cbc6e85000674b0dbb18f95fca09a9ee-1"&gt;&lt;/a&gt;/var/log/freeradius/radacct/*/detail-* {
&lt;a id="rest_code_cbc6e85000674b0dbb18f95fca09a9ee-2" name="rest_code_cbc6e85000674b0dbb18f95fca09a9ee-2" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_cbc6e85000674b0dbb18f95fca09a9ee-2"&gt;&lt;/a&gt;        daily
&lt;a id="rest_code_cbc6e85000674b0dbb18f95fca09a9ee-3" name="rest_code_cbc6e85000674b0dbb18f95fca09a9ee-3" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_cbc6e85000674b0dbb18f95fca09a9ee-3"&gt;&lt;/a&gt;        rotate 90
&lt;a id="rest_code_cbc6e85000674b0dbb18f95fca09a9ee-4" name="rest_code_cbc6e85000674b0dbb18f95fca09a9ee-4" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_cbc6e85000674b0dbb18f95fca09a9ee-4"&gt;&lt;/a&gt;        compress
&lt;a id="rest_code_cbc6e85000674b0dbb18f95fca09a9ee-5" name="rest_code_cbc6e85000674b0dbb18f95fca09a9ee-5" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_cbc6e85000674b0dbb18f95fca09a9ee-5"&gt;&lt;/a&gt;        notifempty
&lt;a id="rest_code_cbc6e85000674b0dbb18f95fca09a9ee-6" name="rest_code_cbc6e85000674b0dbb18f95fca09a9ee-6" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_cbc6e85000674b0dbb18f95fca09a9ee-6"&gt;&lt;/a&gt;}
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Using wildcards with logrotate is asking for trouble, as the manual page warns,
but we thought we knew better... The result was a log directory containing
loads of the following:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-1" name="rest_code_f5d072251ad2444eabdc72b32638bc36-1" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-1"&gt;&lt;/a&gt;server:/var/log/freeradius/radacct/host# ls -al
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-2" name="rest_code_f5d072251ad2444eabdc72b32638bc36-2" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-2"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-09-03 06:25 detail-20130902
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-3" name="rest_code_f5d072251ad2444eabdc72b32638bc36-3" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-3"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-09-05 06:25 detail-20130902.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-4" name="rest_code_f5d072251ad2444eabdc72b32638bc36-4" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-4"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-09-07 06:25 detail-20130902.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-5" name="rest_code_f5d072251ad2444eabdc72b32638bc36-5" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-5"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-09-09 06:25 detail-20130902.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-6" name="rest_code_f5d072251ad2444eabdc72b32638bc36-6" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-6"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-09-11 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-7" name="rest_code_f5d072251ad2444eabdc72b32638bc36-7" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-7"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-09-13 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-8" name="rest_code_f5d072251ad2444eabdc72b32638bc36-8" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-8"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-09-15 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-9" name="rest_code_f5d072251ad2444eabdc72b32638bc36-9" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-9"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-09-17 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-10" name="rest_code_f5d072251ad2444eabdc72b32638bc36-10" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-10"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-09-19 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-11" name="rest_code_f5d072251ad2444eabdc72b32638bc36-11" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-11"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-09-21 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-12" name="rest_code_f5d072251ad2444eabdc72b32638bc36-12" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-12"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-09-23 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-13" name="rest_code_f5d072251ad2444eabdc72b32638bc36-13" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-13"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-09-25 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-14" name="rest_code_f5d072251ad2444eabdc72b32638bc36-14" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-14"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-09-27 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-15" name="rest_code_f5d072251ad2444eabdc72b32638bc36-15" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-15"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-09-29 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-16" name="rest_code_f5d072251ad2444eabdc72b32638bc36-16" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-16"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-01 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-17" name="rest_code_f5d072251ad2444eabdc72b32638bc36-17" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-17"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-03 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-18" name="rest_code_f5d072251ad2444eabdc72b32638bc36-18" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-18"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-05 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-19" name="rest_code_f5d072251ad2444eabdc72b32638bc36-19" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-19"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-07 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-20" name="rest_code_f5d072251ad2444eabdc72b32638bc36-20" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-20"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-09 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-21" name="rest_code_f5d072251ad2444eabdc72b32638bc36-21" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-21"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-11 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-22" name="rest_code_f5d072251ad2444eabdc72b32638bc36-22" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-22"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-13 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-23" name="rest_code_f5d072251ad2444eabdc72b32638bc36-23" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-23"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-15 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-24" name="rest_code_f5d072251ad2444eabdc72b32638bc36-24" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-24"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-17 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-25" name="rest_code_f5d072251ad2444eabdc72b32638bc36-25" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-25"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-19 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-26" name="rest_code_f5d072251ad2444eabdc72b32638bc36-26" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-26"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-21 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-27" name="rest_code_f5d072251ad2444eabdc72b32638bc36-27" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-27"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-23 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-28" name="rest_code_f5d072251ad2444eabdc72b32638bc36-28" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-28"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-25 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-29" name="rest_code_f5d072251ad2444eabdc72b32638bc36-29" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-29"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-27 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-30" name="rest_code_f5d072251ad2444eabdc72b32638bc36-30" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-30"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-29 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-31" name="rest_code_f5d072251ad2444eabdc72b32638bc36-31" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-31"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-10-31 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-32" name="rest_code_f5d072251ad2444eabdc72b32638bc36-32" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-32"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-02 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-33" name="rest_code_f5d072251ad2444eabdc72b32638bc36-33" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-33"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-04 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-34" name="rest_code_f5d072251ad2444eabdc72b32638bc36-34" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-34"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-06 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-35" name="rest_code_f5d072251ad2444eabdc72b32638bc36-35" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-35"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-08 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-36" name="rest_code_f5d072251ad2444eabdc72b32638bc36-36" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-36"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-10 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-37" name="rest_code_f5d072251ad2444eabdc72b32638bc36-37" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-37"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-12 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-38" name="rest_code_f5d072251ad2444eabdc72b32638bc36-38" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-38"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-14 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-39" name="rest_code_f5d072251ad2444eabdc72b32638bc36-39" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-39"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-16 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-40" name="rest_code_f5d072251ad2444eabdc72b32638bc36-40" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-40"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-18 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-41" name="rest_code_f5d072251ad2444eabdc72b32638bc36-41" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-41"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-20 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-42" name="rest_code_f5d072251ad2444eabdc72b32638bc36-42" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-42"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-22 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-43" name="rest_code_f5d072251ad2444eabdc72b32638bc36-43" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-43"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-24 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-44" name="rest_code_f5d072251ad2444eabdc72b32638bc36-44" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-44"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-26 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-45" name="rest_code_f5d072251ad2444eabdc72b32638bc36-45" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-45"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-28 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-46" name="rest_code_f5d072251ad2444eabdc72b32638bc36-46" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-46"&gt;&lt;/a&gt;-rw------- 1 freerad freerad        0 2013-11-30 06:25 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-47" name="rest_code_f5d072251ad2444eabdc72b32638bc36-47" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-47"&gt;&lt;/a&gt;-rw------- 1 freerad freerad 23219192 2013-09-02 21:47 detail-20130902.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
&lt;a id="rest_code_f5d072251ad2444eabdc72b32638bc36-48" name="rest_code_f5d072251ad2444eabdc72b32638bc36-48" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_f5d072251ad2444eabdc72b32638bc36-48"&gt;&lt;/a&gt;server:/var/log/freeradius/radacct/host#
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Fixing logrotate is left for another time. But how do you get rid of all the
0 length files and how do you rename the files that &lt;em&gt;do&lt;/em&gt; have content to something
useful? Most howto's suggest &lt;code class="docutils literal"&gt;basename&lt;/code&gt; or Perl's &lt;code class="docutils literal"&gt;rename&lt;/code&gt;, but they all
can't handle what I call "recursive" file extensions. Here's what I came up
with:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_6f8603432c29408ba9d509312ebebe8b-1" name="rest_code_6f8603432c29408ba9d509312ebebe8b-1" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_6f8603432c29408ba9d509312ebebe8b-1"&gt;&lt;/a&gt;# Delete all 0 length files
&lt;a id="rest_code_6f8603432c29408ba9d509312ebebe8b-2" name="rest_code_6f8603432c29408ba9d509312ebebe8b-2" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_6f8603432c29408ba9d509312ebebe8b-2"&gt;&lt;/a&gt;server:/var/log/freeradius/radacct/host# find . -size 0 -delete
&lt;a id="rest_code_6f8603432c29408ba9d509312ebebe8b-3" name="rest_code_6f8603432c29408ba9d509312ebebe8b-3" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_6f8603432c29408ba9d509312ebebe8b-3"&gt;&lt;/a&gt;# Create a list of mv commands for all remain files
&lt;a id="rest_code_6f8603432c29408ba9d509312ebebe8b-4" name="rest_code_6f8603432c29408ba9d509312ebebe8b-4" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_6f8603432c29408ba9d509312ebebe8b-4"&gt;&lt;/a&gt;server:/var/log/freeradius/radacct/192.168.59.6# ls *.gz | awk -F '.' '{ print "mv " $0 " " $1 ".1.gz" }' &amp;gt; commandfile
&lt;a id="rest_code_6f8603432c29408ba9d509312ebebe8b-5" name="rest_code_6f8603432c29408ba9d509312ebebe8b-5" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_6f8603432c29408ba9d509312ebebe8b-5"&gt;&lt;/a&gt;# Execute the commands (dot space commandfile executes all commands in
&lt;a id="rest_code_6f8603432c29408ba9d509312ebebe8b-6" name="rest_code_6f8603432c29408ba9d509312ebebe8b-6" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_6f8603432c29408ba9d509312ebebe8b-6"&gt;&lt;/a&gt;# commandfile, who knew?)
&lt;a id="rest_code_6f8603432c29408ba9d509312ebebe8b-7" name="rest_code_6f8603432c29408ba9d509312ebebe8b-7" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_6f8603432c29408ba9d509312ebebe8b-7"&gt;&lt;/a&gt;server:/var/log/freeradius/radacct/host# . commandfile
&lt;a id="rest_code_6f8603432c29408ba9d509312ebebe8b-8" name="rest_code_6f8603432c29408ba9d509312ebebe8b-8" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_6f8603432c29408ba9d509312ebebe8b-8"&gt;&lt;/a&gt;# And clean up after ourselves
&lt;a id="rest_code_6f8603432c29408ba9d509312ebebe8b-9" name="rest_code_6f8603432c29408ba9d509312ebebe8b-9" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_6f8603432c29408ba9d509312ebebe8b-9"&gt;&lt;/a&gt;server:/var/log/freeradius/radacct/host# rm commandfile
&lt;a id="rest_code_6f8603432c29408ba9d509312ebebe8b-10" name="rest_code_6f8603432c29408ba9d509312ebebe8b-10" href="https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/#rest_code_6f8603432c29408ba9d509312ebebe8b-10"&gt;&lt;/a&gt;server:/var/log/freeradius/radacct/host#
&lt;/pre&gt;&lt;/div&gt;</description><category>awk</category><category>bash</category><category>english</category><category>find</category><category>linux</category><category>logrotate</category><guid>https://www.ramdyne.nl/posts/fun-with-logrotate-and-wildcards/</guid><pubDate>Sat, 30 Nov 2013 13:47:30 GMT</pubDate></item></channel></rss>