[mythtv-users] trunk gentoo ebuilds and logrotate

freedenizen freedenizen at gmail.com
Thu Sep 22 15:29:03 UTC 2011


On Wed, Sep 21, 2011 at 7:05 PM, Bill Meek <keemllib at gmail.com> wrote:
> Hi;
>
> Does this help?
>
> http://www.mythtv.org/wiki?title=Logging&curid=7289&diff=53235&oldid=53212#Log_file_cleanup
>
> The -delete expression will certainly clean up your logging directory,
> and remember that the find command can take the
>
>  -exec YourCustomArchive.sh {} \;
>
> expression and you can do whatever you want with the
> programname.data.pid.log files.
>
> Then you could use existing logrotate configuration files to
> clean up the archive files.
>
> Bill
>
> * Your script could be as simple as:
>
>  # Convert the program.date.pid.log into program.log
>  ARCHIVE=$(echo $1 | sed -n 's/\.20............\.[0-9]*//p')
>  cat $1 >> $ARCHIVE
>  rm $1

Ah ya, I actually had created a cronjob:
find /var/log/mythtv -mtime +7 -daystart -execdir rm '{}' \; 2>/dev/null

not elegant but it kept the files down.


More information about the mythtv-users mailing list