[mythtv-users] wanted: script to balance autoexpire recordings in storage dirs to avoid premature deletion
Michael T. Dean
mtdean at thirdcontact.com
Mon Jan 17 16:58:49 UTC 2011
On 01/14/2011 01:08 AM, Peter Watkins wrote:
> My problem is that the recordings that allow autoexpire are not
> balanced on the storage directories, so MythTV has on a number of
> occasions deleted new content. The backend will decide it wants to use
> a specific storage directory and will pick an autoexpire-enabled
> recording in that directory, even if it's very new (e.g., new episode
> of a favorite TV show) and there are a bunch of lower priority
> recordings in the other storage directory.
...
> Here's what I'd like: a script I could run periodically (via cron,
> probably at least daily) that would examine the Autoexpire list for
> the entire storage group
There is only one autoexpire list--that includes all recordings on all
hosts and in all Storage Groups and all the SG directories. (So, you'll
have to "sort it out" yourself.) The list is available with:
mythbackend --printexpire
> and ensure that the recordings that would
> "naturally" be chosen to autoexpire soonest are well balanced on the
> storage directories (at least the top 10 or so). For instance, if the
> natural first choice for autoexpire is in directory A, then make sure
> the second choice is in directory B. (Yes, I understand that this
> would require a third partition for moving recordings.) With such a
> script, the worst that would happen is the 2nd choice recording would
> be deleted rather than the 1st. No longer would I need to worry that
> an old priority -20 power search movie would remain while a priority 0
> TV show gets the axe (unless my disks are *really* full of priority 0
> shows, a scenario that I don't think is worth the trouble of trying to
> fix**).
>
> Before I commit time learning the Perl API and cobbling my own script,
> does anyone have anything like this already built?
FWIW, I haven't seen such a script. Then again, the only scripts I
really know about are those at http://www.mythtv.org/wiki/Category:Scripts .
> ** I have no problem with the idea that I might lose new TV shows if
> my disks are full of no-expire shows and shows at similar priority
> levels. Nor am I terribly worried about the notion that I might lose a
> new show to fit a -20 movie if the disks are full of priority 0 shows
> (although that would be a nice feature). It's the occasional loss of
> priority 0 recordings when the other storage directory has a *bunch*
> of -20 recordings that bugs me.
"Soon", changes will go into MythTV that will allow us to completely
change the way we're storing information about recordings (and MythVideo
videos). Once these changes are in, a gradual transition to the new
"recordedfile" schema layout will take place. Once that transition is
complete for recordings, it will allow us to identify where each
recording "most likely" exists.
Additionally, we*** plan to move some code that currently exists only
within the auto-expirer to be available to all of MythTV. This code
tracks which SG directories are available from which hosts, where those
directories are redundant, and which host is the "local" host for the
directory. Once that is available and we know where each recording most
likely exists, we'll have 2 new capabilities: first, we'll be able to
identify the most-efficient path for getting the recording from disk to
the frontend/client that requests it (as MythTV will actually understand
your file system layout); and second, we'll be able to create a new SG
scheduler method that takes into account auto-expire priority when
choosing the most-appropriate directory/filesystem to use for a new
recording. Unfortunately, there's a lot of work that has to happen for
this to become a reality, so you'll likely want to do your script for
the (not-so) short term.
Mike
*** Currently, there's probably more "me" in this "we" than anyone else,
but assuming someone smarter than I doesn't provide a good reason not to
do this, it will be the plan. :)
More information about the mythtv-users
mailing list