[mythtv] Simple Auto Expiration/Deletion code is now in CVS.

Chris Pinkham cpinkham at bc2va.org
Sun Jul 6 15:22:15 EDT 2003


Quoting my own message from the "Automatic Deletion" thread from a few days
ago...

> I have working code right now which implements AutoExpiration of old
> files based upon record date.  The code is designed to allow easy plugin
> of other expiration methods.  It runs as a thread on each backend and uses
> Myth's internal message passing code so it doesn't have to open any socket
> connections.  I need to hook up a couple quick screens to allow turning the
> 'autoexpire' field on/off on the record and recorded tables but then I'll
> commit it to CVS.  So, give me a few days and then you can just work on
> coding other auto-expire methods (like basing it on record rating, etc.)

The code described above is now in CVS if people want to give it a shot and/or
write some new methods for determining what to auto-expire (like sort by
reverse recording rank maybe by storing the rank a program was recorded at).

The Auto-Expire code is turned OFF by default and the Default Auto-Expire
value for new recordings is OFF as well.  So, to activate auto-expire, you
have to first go into the TV/General settings screen (2nd page) and turn
on Auto-Expire by setting the Disk Space Threshold to something > 0.  If
the disk space threshold is set to 2 Gigs, then whenever the code checks
for free disk space and it's below 2 Gigs then the auto-expire process will
be run.

In order to give the auto-expire process some programs to expire, you have to
do a few things:

    * Set "Auto-Expire Default" to ON if you want new scheduled programs
      to be allowed to auto-expire by default
    * Go into each previously entered scheduled program that you want to
      allow to auto-expire and change it's Auto-Expire value to ON from
      the advanced recording options screen.
    * For old already-recorded programs, you can set them to Auto-Expire by
      hitting 'I' on the playback or delete screens and saying 'Yes' to
      allow that program to Auto-Expire.

The only current Auto-Expire method is Oldest First.  So, the oldest recorded
program that has it's auto-expire value set to ON will be expired first.

If you want to see what order programs will be expired in, you can run
mythbackend with the --printexpire option and get a list.  The last item
on the list is the one that will expire first. 

	mythbackend --printexpire

The expire method and disk space threshold are Global settings so they apply
to each backend, but each backend server runs its own auto-expire process and
will only Auto-Expire programs that it has recorded.

Chris


More information about the mythtv-dev mailing list