[mythtv-users] Database & Storeage Directory Housekeeper Setup Page

Michael T. Dean mtdean at thirdcontact.com
Tue Jan 31 23:49:51 UTC 2012


On 01/31/2012 05:58 PM, Harry Coin wrote:
> I have run into usability issues that cry out for a page in the mythtv-
> setup program that has an 'overall long-term housekeeping' function to
> include these specific abilities:
>
> 1. List all backends and frontends the database knows about, with the
> ability to delete everything to do with retired systems.  Backends come
> and go, but their data is forever.  Put in a new frontend or backend that
> happens to have the same name as an old one long forgotten or upgrade
> (with different guts entirely) and it all goes horribly wrong.

The only things that get left over after a backend is retired are:
   a) settings
   b) recording files
   c) Storage Group directory list overrides
   d) Capture Cards and Input Connections

As far as these are concerned.

a) Cleanup of settings is pretty much irrelevent.  The only benefit of 
deleting them is recovery of a tiny bit of HDD space on the MySQL 
server.  There's a small disadvantage that keeping them in place may 
result in a user getting settings values which aren't appropriate for a 
new host if they later reuse that host name, but this can be fixed by 
providing an approach to reset all settings (something which we will 
have, eventually).  We may actually allow users to delete settings for a 
given host, too, but only because no one seems to believe me that all 
they get from doing so is <100kiB of HDD space (including data and 
indices--in my testing, less than 10kiB).  (In truth, you also leave 
behind key bindings, but we now have the ability to reset them to 
defaults inside mythfrontend Utilities/Setup|Edit Keys, in unstable, so 
that will be in 0.25.)

b) In theory, when you decommission a backend with recordings, you would 
have done something with the recording files you actually wanted to 
keep--such as put them into MythVideo directories for long-term archival 
(i.e. using http://www.mythtv.org/wiki/Mythvidexport.py ), or, if you 
felt there was a reason to keep them in Watch Recordings, as described 
in "Retiring an old backend," below.  You can clean up the metadata for 
those recordings you don't want to keep with find_orphans.py (see below).

c) If you set up your Storage Groups the way 99.99999999999999% of users 
should--such that you only define Storage Group directory lists on the 
master backend and /never/ create directory list overrides on any remote 
backend--this will never be an issue.  See 
http://www.mythtv.org/wiki/Storage_Groups#Quick_Rules  (Currently, the 
only exception to this rule is Videos and Images Storage Groups--which 
require an override on each host that contains Videos (MythVideo) 
files.  There's a very good chance that 0.25 will ship without this 
requirement, at which point we'll recommend never doing a directory list 
override on any remote backend for any Storage Group.)

d) You can clear out old Capture Cards and/or Input Connections with 
"Delete all capture cards on <hostname>" or "Delete all capture cards", 
as described in "Retiring an old backend," below.

See http://www.mythtv.org/wiki/Backend_migration#Retiring_an_old_backend

Oh, and if you're just changing the host name of an old backend, all of 
the above is handled for you, automatically, by 
http://www.mythtv.org/wiki/Database_Backup_and_Restore#Change_the_hostname_of_a_MythTV_frontend_or_backend 
.

If you're replacing a host, ideally, you'd use the same host name for 
the new host, then reconfigure only what you need to reconfigure (such 
as the Capture Cards, using "Delete all capture cards on <hostname>" or 
"Delete all capture cards", since you'll likely have new drivers for 
them, so things may have changed from your old configuration).

> 4. A button to bulk purge all storage group .png and recreate them based
> on what's currently in the storage groups-- across backends.  A warning
> flag and delete option on video files with a file size too short to
> creditably contain the indicated viewing time.
>
> 5. A button to list all files in any Myth controlled directory without
> known current connection in the database (to include video files whose
> filesize is unreasonable given the assumed video length).  A button to
> list all entries in the database pointing at files that don't exist/can't
> be accessed that only works if all current storage groups and other
> directories are accessible.

Both of these will be handled, eventually, but it's not nearly as simple 
as one might expect.  I have partial patches handling this, but as I 
have 3 TODO lists (and 92 in-progress patches) for MythTV, it's 
prioritized appropriately with respect to all my other tasks.

For now, we only support cleanup of orphaned files/metadata using the 
http://www.mythtv.org/wiki/Find_orphans.py script, which does an 
extremely good job of cleaning up any cruft left over when something 
messes with files outside of MythTV (or the occasional orphaned preview 
pixmap--which, btw, will no longer be a problem after a major change 
that I'll be working on after 0.25 release).

Mike


More information about the mythtv-users mailing list