[mythtv-users] Script to remove all old recordings prior a given date

Peter Bennett cats22 at comcast.net
Thu Nov 24 04:15:52 UTC 2016


On 11/23/2016 10:49 PM, Jean-Yves Avenard wrote:
> Hi
>
> Having a 32TB backend, the amount of recordings kept has become insane.
>
> How could I remove in one go all the recording that are older than two
> years old?
>
> I guess after that, I can use the find_orphans script to clean up the
> storage space.
> _______________________________________________
There have been people in the list who have reported using find_orphans
to clean up thousands of deleted files and they have had some serious
problem - I am not sure of the details or if it has been fixed.

For your case I think what I would do is write a sql script, something
like this

Find the recgroupid:
select recgroupid from recgroups where recgroup = 'Deleted';

Then:
update recorded set recgroup = 'Deleted',
recgroupid = xxxxx , autoexpire = 9999
where starttime < '2014-11-23' ;

After the appropriate delete waiting time they will be deleted. I have
used this a lot and not had problems with doing it. (But not with
thousands of files at one time).

It also gives you time to change your mind (I have my delete delay set
at 7 days).

Peter


More information about the mythtv-users mailing list