Difference between revisions of "Logrotate - all applications"

From MythTV Official Wiki
Jump to: navigation, search
m (add 0.25 support token)
(should have copy/pasted the tested script instead of changing differences from the mythfrontend template manually :); mention that this obviates other config files)
Line 3: Line 3:
 
== Log rotation with --logpath logging ==
 
== Log rotation with --logpath logging ==
  
This configuration will work with MythTV logging using either the [[Logging#File_Logging|--logpath]] or [[Logging#syslog_Logging|--syslog]] argument.
+
This configuration will work with MythTV logging for all MythTV applications using either the [[Logging#File_Logging|--logpath]] or [[Logging#syslog_Logging|--syslog]] argument.  If using this configuration, other MythTV logrotate configuration files are unnecessary.
  
 
{{Script info
 
{{Script info
Line 22: Line 22:
 
         sharedscripts
 
         sharedscripts
 
         olddir /var/log/mythtv/old
 
         olddir /var/log/mythtv/old
         postrotate
+
         lastaction
 
                 killall -HUP mythbackend
 
                 killall -HUP mythbackend
 
                 killall -HUP mythfrontend
 
                 killall -HUP mythfrontend

Revision as of 21:09, 17 May 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 -name 'mythfrontend*' -type f -mtime +30 -delete
        endscript
}