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

Files not deleted
http://forums.linhes.org/viewtopic.php?f=6&t=21116
Page 1 of 1

Author:  mkaz [ Thu Jun 10, 2010 3:38 am ]
Post subject:  Files not deleted

R5.5
I have programs that are showing up in the System Status/AutoExpire List as deleted. They are months old. I used to have programs set not to delete immediately, but after 3 days. I turned the feature back to 0 days (delete immediately) and the programs are still there. The data files for the programs themselves are not there. The programs cannot be deleted, but KM thinks they are still there taking space. Inspection of the mythbackend.log shows

Code:
2010-06-10 05:15:26.692 Expiring 3146 MBytes for 1006 @ Mon Mar 29 20:00:00 2010 => Chuck "Chuck Versus the American Hero"
2010-06-10 05:15:26.700 mythbackend: Delete Recording: File /GetPlaybackURL/UNABLE/TO/FIND/LOCAL/FILE/ON/mythtv/1006_20100326020400.mpg does not exist for chanid 1006 at Fri Mar 26 02:04:00 2010 when trying to delete recording.
2010-06-10 05:15:26.707 autoexpire: Expiring Program: Expiring 3146 MBytes for 1006 @ Mon Mar 29 20:00:00 2010 => Chuck "Chuck Versus the American Hero"


that KM is trying to delete them, but is having a problem. I did the steps under RepairingMythConvergDB in the KM wiki and there were no errors.

How do I get rid the database of these pesky ghosts?

Author:  manicmike [ Thu Jun 10, 2010 4:48 pm ]
Post subject:  Re: Files not deleted

mkaz wrote:
How do I get rid the database of these pesky ghosts?


Hope I haven't misunderstood your problem. I'm assuming that your backend is trying to delete files that it's expecting to find in /myth/tv and it can't as they're already long gone. My solution would involve simply getting a list of the files and creating empty files with the same names that your backend can successfully remove.

If that's a reasonably accurate summary, here's how I'd do it:

Grep the log file for an appropriate string to retrieve the names of all the files and get them into a list.
E.g.
grep FIND /var/log/mythtv/mythbackend |grep LOCAL |awk -F/ '{print $10}'|awk '{print $1}' |sort|uniq > /root/orphans.txt

Check that this actually works (I just made it up). You can do this by removing everything after the last uniq. If you end up with a list of files in /root/orphans.txt that end in .mpg, you can then do this:

for i in /root/orphans.txt;do touch /myth/tv/$i;done

This will create empty files in /myth/tv that you can then delete.

If you didn't get the file names, chances are that my one minute one-liner is faulty. If you can't adjust this, I can do it for you.

Mike

Author:  mkaz [ Thu Jun 10, 2010 6:38 pm ]
Post subject: 

That worked! Thanks a lot.

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