Difference between revisions of "Logrotate - all applications"

From MythTV Official Wiki
Jump to: navigation, search
(Oops, copy/paste and didn't update mythfrontend in find command. Thanks to Myk for noticing.)
(Log rotation with --logpath logging: old file names will be modified, so won't end with .log, so fix the delete)
Line 26: Line 26:
 
                 killall -HUP mythfrontend
 
                 killall -HUP mythfrontend
 
                 killall -HUP mythlcdserver
 
                 killall -HUP mythlcdserver
                 find /var/log/mythtv/old -name '*.log' -type f -mtime +30 -delete
+
                 find /var/log/mythtv/old -type f -mtime +30 -delete
 
         endscript
 
         endscript
 
}   
 
}   

Revision as of 14:16, 21 July 2012

For most distros, save the configuration file to /etc/logrotate.d/mythtv

Log rotation with --logpath logging

This configuration will work with MythTV logging for all MythTV applications using either the --logpath or --syslog argument. If using this configuration, other MythTV logrotate configuration files are unnecessary.


Author unknown
Description Example configuration file for using logrotate to rotate your MythTV log files.
Supports Version25.png  


Script.png /etc/logrotate.d/mythtv

/var/log/mythtv/*.log {
        weekly
        rotate 8
        missingok
        ifempty
        nocreate
        nocompress
        sharedscripts
        olddir /var/log/mythtv/old
        lastaction
                killall -HUP mythbackend
                killall -HUP mythfrontend
                killall -HUP mythlcdserver
                find /var/log/mythtv/old -type f -mtime +30 -delete
        endscript
}