[vdr] Cleanup Thread (like .update)

Darren Salt linux at youmustbejoking.demon.co.uk
Tue Oct 4 00:39:05 CEST 2005


I demand that Klaus Schmidinger may or may not have written...

> hgm.bg wrote:
>> Is there a possibility to implement the same way .update works a way to
>> start the cleanup thread which is deleting the deleted recordings ? I'm
>> usually low an diskspace and when try to free space for new recordings it
>> takes mostly more than 5 minutes of an idle VDR to delete the recordings
>> on the system. Sometimes 5 minutes is too long :) [...]

I find that it often takes too long too...

> recording.c:

> #define REMOVECHECKDELTA 3600 // seconds between checks for removing deleted files

Experimental patch (compile-tested only) attached. It adjusts the removal
check scheduling so that removal occurs at (by default) 6 minutes after
deletion. There is a 1-minute minimum delay, and the delay is reset every
time a recording is marked for deletion.

This also gives you enough time to unmark a recording, either by renaming it
manually or by using an undelete plugin.

-- 
| Darren Salt | nr. Ashington, | d youmustbejoking,demon,co,uk
| Debian,     | Northumberland | s zap,tartarus,org
| RISC OS     | Toon Army      | @                      Say NO to UK ID cards
|                                                       http://www.no2id.net/

You will survive the conflagration.
-------------- next part --------------
--- vdr-1.3.34/recording.c~
+++ vdr-1.3.34/recording.c
@@ -61,10 +61,10 @@
 bool VfatFileSystem = false;
 
 static cRecordings DeletedRecordings(true);
+static time_t LastRemoveCheck = 0;
 
 void RemoveDeletedRecordings(void)
 {
-  static time_t LastRemoveCheck = 0;
   if (LastRemoveCheck == 0) {
      DeletedRecordings.Update();
      LastRemoveCheck = time(NULL) - REMOVECHECKDELTA * 9 / 10;
@@ -718,6 +718,7 @@
         }
      isyslog("deleting recording %s", FileName());
      result = RenameVideoFile(FileName(), NewName);
+     LastRemoveCheck = time(NULL) - max (60, REMOVECHECKDELTA * 9 / 10);
      }
   free(NewName);
   return result;


More information about the vdr mailing list