Cleaning up livetv recordings

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: Cleaning up livetv recordings

Post by paulh »

Your on the wrong screen I'm talking about the 'Watch Recordings' screen which shows you the list of available recordings. In MythCenter-wide you have two lists with the left one active press menu choose Change Group Filter. On the list you should find a group called LiveTV. The right list will now show you all the LiveTV recordings. Press 'D' or press 'M' and select the Delete option. If you want to delete all LiveTV recordings the easiest way is to create a play list. You can do that from the menu with the left list active and choose "Add this Group to Playlist". You can then use the Menu to choose Playlist Options -> Delete.
gpw928
Junior
Posts: 51
Joined: Tue Feb 12, 2019 5:59 am
Location: Rural NSW
Australia

Re: Cleaning up livetv recordings

Post by gpw928 »

Thank you for that. I have had to leave the site, but have confirmed your process on another MythTV server. I'll return to the task as soon as I can, in a few days time.
gpw928
Junior
Posts: 51
Joined: Tue Feb 12, 2019 5:59 am
Location: Rural NSW
Australia

Re: Cleaning up livetv recordings

Post by gpw928 »

paulh wrote:
Wed Feb 15, 2023 10:12 pm
Your on the wrong screen I'm talking about the 'Watch Recordings' screen which shows you the list of available recordings.
I have now deleted all the recordings using the menu, as you have suggested. Plus I have deleted another 86 files in the livetv directory that were "left over" when the menus told me there was nothing more in the filter group.

I think that the livetv problem is resolved. Thank you.
gpw928
Junior
Posts: 51
Joined: Tue Feb 12, 2019 5:59 am
Location: Rural NSW
Australia

Re: Cleaning up livetv recordings

Post by gpw928 »

gedakc wrote:
Wed Feb 15, 2023 8:26 pm
gpw928 that sure is a lot of recordings with a "1" indicating delete pending. Did you invoke the eliminate deletepending recordings command so that mythbackend can start to perform the deletes? If so you can check on the progress by running the showpendings command.
I followed the Wiki instructions to remove recordings which are pending deletion:

Code: Select all

UPDATE recorded SET deletepending = 0 where recgroup = 'Deleted' or recgroup = 'LiveTV';
This resulted in the problem appearing to go away:

Code: Select all

mysql> select deletepending, recgroup, count(*) from recorded group by deletepending, recgroup;
+---------------+----------+----------+
| deletepending | recgroup | count(*) |
+---------------+----------+----------+
|             0 | LiveTV   |       44 |
|             0 | Default  |     2344 |
|             0 | Deleted  |     1714 |
+---------------+----------+----------+
3 rows in set (0.04 sec)
But they rise again like Lazarus:

Code: Select all

mysql> select deletepending, recgroup, count(*) from recorded group by deletepending, recgroup;
+---------------+----------+----------+
| deletepending | recgroup | count(*) |
+---------------+----------+----------+
|             0 | LiveTV   |       44 |
|             0 | Default  |     2344 |
|             1 | Deleted  |     1685 |
|             0 | Deleted  |        2 |
+---------------+----------+----------+
4 rows in set (0.04 sec)
That number of 1685 does not seem to be changing. Will check again tomorrow.
gedakc
Junior
Posts: 97
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: Cleaning up livetv recordings

Post by gedakc »

gpw928 wrote:
Mon Feb 20, 2023 3:45 am
That number of 1685 does not seem to be changing. Will check again tomorrow.
That is definitely different behaviour than what I experienced. Maybe a different root cause?
gpw928
Junior
Posts: 51
Joined: Tue Feb 12, 2019 5:59 am
Location: Rural NSW
Australia

Re: Cleaning up livetv recordings

Post by gpw928 »

By repeatedly stopping the backend, setting "deletepending = 0", and restarting the backend, I have finally removed all the Deleted recordings:

Code: Select all

mysql> select deletepending, recgroup, count(*) from recorded group by deletepending, recgroup;
+---------------+----------+----------+
| deletepending | recgroup | count(*) |
+---------------+----------+----------+
|             0 | LiveTV   |       62 |
|             0 | Default  |     2338 |
|             0 | Deleted  |        9 |
+---------------+----------+----------+
This took many iterations, with anything from a few, to a few hundred, recordings being deleted in any one iteration.

I eventually managed to free up about 3TB of disk space!

There were a lot of errors in the log of the general type:

Code: Select all

Feb 23 00:00:45 umtvs1 mythbackend: mythbackend[1589352]: E CoreContext mainserver.cpp:3147 (DoHandleDeleteRecording) MainServer: ERROR when trying to delete file: GetPlaybackURL/UNABLE/TO/FIND/LOCAL/FILE/ON/umtvs1/1003_20110830203044.mpg. File doesn't exist.  Database metadata will not be removed.
So I'm guessing that the database may not be in the best possible shape.

I have the general impression that response from the backend is now slugish in all aspects, whether it's bring up thumbnails, fast-forwarding a recording, or just starting to play live TV, everything seems to happen much more slowly than it used to. I'm wondering if database content is a mess. In any event, I'll let it run for a few days and contemplate whether "database verification and clean out" might be worth considering.

Thank you to all those who assisted.
gedakc
Junior
Posts: 97
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: Cleaning up livetv recordings

Post by gedakc »

You might try optimizing the database to get the performance back. See MythTV User Manual:Periodic Maintenance for more details on how to make a backup and then optimize the database.
PhilB
Senior
Posts: 403
Joined: Sun May 11, 2014 6:23 pm
Great Britain

Re: Cleaning up livetv recordings

Post by PhilB »

Congratulations! I thought I had the Guiness word record for volume of spurious recordings but you have overtaken me spectacularly!
The suspicion is that these are created by lots of manual deletes just before a Mythwelcome closedown. I found that you just had to give the backend time to delete them (about 10 sec/recording).
You could fix this by purging before you start the backend. See this:
https://www.mythtv.org/wiki/User_Manual ... g_deletion
Just chuck out the stuff relating to the HDHomerun .
Phil
Post Reply