LinHES Forums
http://forums.linhes.org/

find_orphans.py not removing Video/Recordings
http://forums.linhes.org/viewtopic.php?f=25&t=29997
Page 1 of 1

Author:  Girkers [ Sun Aug 09, 2020 3:42 am ]
Post subject:  find_orphans.py not removing Video/Recordings

When I run the script it finds stuff but never deletes it when I ask it too.

Any idea on how to troubleshoot the issue?

Cheers,

Girkers

Author:  knappster [ Sun Aug 09, 2020 5:42 am ]
Post subject:  Re: find_orphans.py not removing Video/Recordings

Maybe a silly question, but are you running as user mythtv? Permissions issue is what comes to mind for me. You could double check that the files are owned by the same user running find_orphans.

Author:  Girkers [ Sun Aug 09, 2020 8:39 pm ]
Post subject:  Re: find_orphans.py not removing Video/Recordings

Permissions did have something to do with it, but didn't solve all of my issues.

I had been running the command through an SSH session logged in as root, this had filed to delete the files. I ran the command
Code:
su mythtv
but this didn't seem to make a difference. Using a terminal directly on the BE did not help either.

So working along the lines of it being a permissions issue, I changed the owner of all of my Live TV files and also made sure that I had write permission to this and then when I ran the command through the terminal directly the BE it was able to remove the recordings.

Alas this has not been able to clean up the DB and remove orphaned recording entries. I have optimized the DB and tried again but the entries remain.

So I am almost there, any other ideas on how to fix the DB entries?

Author:  welner [ Mon Aug 10, 2020 5:26 pm ]
Post subject:  Re: find_orphans.py not removing Video/Recordings

This may not solve all of your issues, but perhaps it may allow your ssh session to produce the same results as logging in directly on the BE...

instead of "su mythtv" (when logged in as root), I would suggest doing:

Code:
su - mythtv


note the dash. this will get you the target users environment

related to needing to change ownership, I would be curious what the ownership and permissions were before you changed them, and what you needed to change them to.

login info for the database is stored in the mythtv home directory, so if the database isn't getting updated, and you are needing to change ownership, it smells like you really aren't the user you think you are. however, since you logged in via an xterm on the mythtv box itself, then that blows that theory.

be that as it may, I would suggest doing a 'whoami' and 'printenv' to verify the user and environment and that you have access to /home/mythtv/.mythtv/config.xml

Author:  Girkers [ Tue Aug 11, 2020 4:07 am ]
Post subject:  Re: find_orphans.py not removing Video/Recordings

Thanks welner for the information.

I tried again with the correct user but alas it did not help, I confirmed that I had access to the file as you had suggested and I checked and it did have the database info in it and it was owned by mythtv.

Having it fail again I tried doing a search on the Official MythTV forums and a post pointed me to this page https://www.mythtv.org/wiki/Frequently_Asked_Questions#How_do_I_remove_recordings_that_no_longer_exist_on_disk.3F. Following these directions I was able to remove 25 of the 27 entries in my Database.

Now how do I remove the last two (2) problems? Well success!

I looked at the names of the two (2) programs that were still left and found that they were Live TV programs, not something that I would normally record. Using my new found knowledge from the above link I changed the Group view to Live TV and found my two (2) rogue recordings and deleted them. Yippie!

As to your other query Welner, my setup is that I store all of my data on a NAS as my BE is virtual and when I did a directory listing most of them were owned by mythtv, however there were one or two owned by root. I chown, to mythtv, and chmod +w for the whole directory and then the find_orphans.py worked as expected. I could not explain how the permissions got screwed up.

Thanks everyone for your help.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/