Difference between revisions of "Logrotate - all applications"

From MythTV Official Wiki
Jump to: navigation, search
(should have copy/pasted the tested script instead of changing differences from the mythfrontend template manually :); mention that this obviates other config files)
(v0.26 is the current version, so should be at the top)
 
(4 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
{{Script info
 
{{Script info
 
|short=logrotate configuration for MythTV applications
 
|short=logrotate configuration for MythTV applications
|long=Example configuration file for using logrotate to rotate your MythTV log files.
+
|long=Example configuration file for using logrotate to rotate your MythTV log files
 
|category=Log Rotation Configuration Files
 
|category=Log Rotation Configuration Files
 
|name=logrotate - all applications
 
|name=logrotate - all applications
 +
|author=Beirdo
 +
|S26=yes}}
 +
{{Code box|/etc/logrotate.d/mythtv|
 +
<pre>
 +
/var/log/mythtv/*.log {
 +
        weekly
 +
        rotate 8
 +
        missingok
 +
        ifempty
 +
        nocreate
 +
        nocompress
 +
        sharedscripts
 +
        olddir /var/log/mythtv/old
 +
        lastaction
 +
                killall -HUP mythlogserver
 +
                find /var/log/mythtv/old -type f -mtime +30 -delete
 +
        endscript
 +
 +
</pre>
 +
}}
 +
 +
 +
 +
{{Script info
 +
|short=logrotate configuration for MythTV applications (v0.25)
 +
|long=Example configuration file for using logrotate to rotate your MythTV log files (for v0.25).
 +
|category=Log Rotation Configuration Files
 +
|name=logrotate - all applications
 +
|author=Beirdo
 
|S25=yes}}
 
|S25=yes}}
 
{{Code box|/etc/logrotate.d/mythtv|
 
{{Code box|/etc/logrotate.d/mythtv|
Line 26: Line 55:
 
                 killall -HUP mythfrontend
 
                 killall -HUP mythfrontend
 
                 killall -HUP mythlcdserver
 
                 killall -HUP mythlcdserver
                 find /var/log/mythtv/old -name 'mythfrontend*' -type f -mtime +30 -delete
+
                 find /var/log/mythtv/old -type f -mtime +30 -delete
 
         endscript
 
         endscript
 
}   
 
}   
Line 32: Line 61:
 
}}
 
}}
  
 +
 +
[[Category:logrotate_Configuration_Files]]
 
[[Category:Log_Rotation_Configuration_Files]]
 
[[Category:Log_Rotation_Configuration_Files]]

Latest revision as of 16:42, 12 March 2013

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 Beirdo
Description Example configuration file for using logrotate to rotate your MythTV log files
Supports Version26.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 mythlogserver
                find /var/log/mythtv/old -type f -mtime +30 -delete
        endscript
}   



Author Beirdo
Description Example configuration file for using logrotate to rotate your MythTV log files (for v0.25).
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
}