[mythtv-users] Deleting recordings after conversion

Thomas Boehm mythtv-users at lists.boehmi.net
Sat Oct 19 13:07:05 UTC 2013


Michael T. Dean wrote:
> On 10/16/2013 01:40 PM, Thomas Boehm wrote:

>> echo "update recorded set recgroup = 'Deleted', autoexpire = 999 where
>> chanid = '$3' and starttime = '$4';"`|mysql --batch --skip-column-names
>> --user="${DBUserName}" --password="${DBPassword}" -h "${DBHostName}"
>> "${DBName}"
>>
>> This moves the recording into the "Deleted" recording group and gives it
>> a high auto expire priority. Of course you need to substitute the
>> variables with yours.
> 
> Much better than using bash + echo + mysql  + direct DB editing (which
> can result in corrupt data in your DB) would be to use a simple Python
> script to delete the recording.  That way, in the event (or when, I
> should say) the database schema changes, your user job will continue to
> work and you won't break anything.

To a non-(python)programmer that script looks by far more complicated
than that simple bash one liner.

And are you saying that in the future the table "recorded" or the
columns "recgroup" or "autoexpire" could be named differently? And what
guaranties that the python script keeps working in that case?



More information about the mythtv-users mailing list