<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 3 December 2016 at 06:16, Peter Bennett <span dir="ltr"><<a href="mailto:cats22@comcast.net" target="_blank">cats22@comcast.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">On 12/02/2016 01:38 PM, Michael T. Dean wrote:<br>
> On 12/02/2016 11:16 AM, Peter Bennett wrote:<br>
>> One of my raspberry Pi's started acting strangely a few days ago and I<br>
>> found it had run out of disk space.<br>
>><br>
>> The raspberry Pi disk is an 8 GB SD card.<br>
>><br>
>> I found that the directory ~/.mythtv/cache/remotecache was using 1.2 GB.<br>
>> On a normal frontend this may not be an issue but on a Raspberry Pi with<br>
>> only 8 GB available this can be a problem. This directory has many files<br>
>> with names like 3707_20161124170000.ts.png.<br>
>><br>
>> Can anybody tell me if this directory ever gets cleaned up by the system<br>
>> or will it go on increasing forever. Do those files get deleted when the<br>
>> relevant recording is deleted?<br>
><br>
> No.  No one has yet implemented any cleanup there.  Users can<br>
> (occasionally/at shutdown/before startup/...) delete the<br>
> ~/.mythtv/remotecache directory as desired (as well as any other cache<br>
> in ~/.mythtv, including themecache, thumbcache, and Cache-*). The only<br>
> downside to doing so is that any images required during running will<br>
> have to be transferred (and scaled/...) when needed.<br>
><br>
> Remember that any automatic cleanup would have to consider that<br>
> there's potentially a copy on each frontend-running system.  So,<br>
> event-based (such as on-delete) cleanup would require messages to all<br>
> running frontends--and would miss any disconnected/not-running<br>
> frontends.  Also, determining that the image is no longer<br>
> necessary/used is very difficult, especially for metadata images (some<br>
> of which are used by any episode of the series, or for episodes that<br>
> don't have any specific image, or ...).<br>
><br>
> For a resource-constrained device like the pi, you could just clean it<br>
> up in a shell script using find...<br>
><br>
> find ~/.mythtv/remotecache -atime +7 -delete<br>
><br>
> to delete any that haven't been accessed in the last 7 days, or<br>
> whatever you like.  Put this in the startup or shutdown script for<br>
> mythfrontend and it's semi-automatic.<br>
><br>
> I'd actually suggest a similar type approach if you want to automate<br>
> it (but not using find).  You could run a task in the frontend<br>
> HouseKeeper that deletes any remotecache images that haven't been<br>
> accessed in the last month or so?  Ideally you'd pick a number that<br>
> just works for people, rather than having a setting to adjust it--and<br>
> since you're using one of the most-resource-constrained devices, you<br>
> should be able to find an appropriate value.  (FWIW, I don't know if<br>
> Qt has a way to find a file's access times--it may not since not all<br>
> file systems support ctime/mtime/atime--but if nothing else, you can<br>
> use C/C++ code.)<br>
><br>
> Mike<br>
<br>
</div></div>Thanks Mike. I have added it to my to-do list. I should also look at<br>
other cached files at the same time.<span class="gmail-HOEnZb"><font color="#888888"><br></font></span></blockquote><div> </div></div></div><div class="gmail_extra">Bear in mind that if you mount directories using the noatime option, which is quite common, the access time of the files will never be updated, so this will likely delete everything after 7 days!</div><div class="gmail_extra"><br></div><div class="gmail_extra">Alternative options in find would be -mtime, which is the creation/last modified time.<br></div></div>