[mythtv-users] Database filled up first partition

chris at cpr.homelinux.net chris at cpr.homelinux.net
Sat Sep 2 00:46:51 UTC 2006

On Fri, Sep 01, 2006 at 09:05:42PM +0800, William Kenworthy wrote:
> Also check out the mythbackend.log file - mine just grew to 1.5 Gbytes -
> a bit disastrous on a 6Gb partition!
> echo > /var/log/mythtv/mythbackend.log fixed it.

Is there any particular reason why you are not using Linux's usual
"logrotate" facility to archive, compress and eventually delete old
logs?  The Debian packages for MySQL and MythTV use it by default, and
if you're compiling your own packages it's certainly not difficult to
configure logrotate manually.

A sample /etc/logrotate.d/mythtv entry:

# Set default values for all log files first...

# Rotate the logs once a week, or more frequently if they 
# exceed 10Mb in size (size is checked daily).
size 10M

# 'copytruncate' is used for logs generated by 
# currently-running programs that should not be restarted 
# (and can't be signalled to start a new log) after the 
# rotation.  It duplicates the existing log file and then 
# sets the length of the existing file to 0.  The only time 
# this would break would be if the program writing the log 
# was using lseek.

# After rotating the files, leave the most recent rotated 
# copy alone but gzip everything else to save space.

# If a log isn't present then don't worry about it.

# Don't rotate an empty file.

/var/log/mythtv/mythbackend.log {
  # Keep logs until they are 2 months old or the number of 
  # logs reaches 12.  If the log files stay small, the age will 
  # kick in first and you'll only have 8 log files.  If they 
  # get larger than 10Mb then you won't keep all 60 days.
  rotate 12
  maxage 60

/var/log/mythtv/mythfilldatabase.log {
  rotate 2

More information about the mythtv-users mailing list