From patchwork Mon Oct 3 22:39:05 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Salt X-Patchwork-Id: 12053 Received: from anchor-post-34.mail.demon.net ([194.217.242.92]) by www.linuxtv.org with esmtp (Exim 4.50) id 1EMZNR-0006SQ-SC for vdr@linuxtv.org; Tue, 04 Oct 2005 01:05:45 +0200 Received: from youmustbejoking.demon.co.uk ([212.228.127.8] helo=pentagram.youmustbejoking.demon.co.uk) by anchor-post-34.mail.demon.net with esmtp (Exim 4.42) id 1EMZNP-0009eL-FO for vdr@linuxtv.org; Mon, 03 Oct 2005 23:05:45 +0000 Received: from [192.168.0.2] (helo=riscpc) by pentagram.youmustbejoking.demon.co.uk with esmtp (Exim 4.50) id 1EMZNO-0005EH-AH for vdr@linuxtv.org; Tue, 04 Oct 2005 00:05:42 +0100 Date: Mon, 03 Oct 2005 23:39:05 +0100 From: Darren Salt To: vdr@linuxtv.org Subject: Re: [vdr] Cleanup Thread (like .update) Message-ID: <4DB44359D0%linux@youmustbejoking.demon.co.uk> References: <433E8162.6060703@cadsoft.de> In-Reply-To: <433E8162.6060703@cadsoft.de> User-Agent: Messenger-Pro/3.30b1 (MsgServe/3.10) (RISC-OS/4.02) POPstar/2.06-ds.5 X-Editor: Zap 1.47 (06 Aug 2005) [TEST], ZapEmail 0.28.3 (25 Mar 2005) (32) X-SDate: Mon, 4416 Sep 1993 23:39:05 +0100 X-Message-Flag: Outlook Express is broken. Upgrade to mail(1). MIME-Version: 1.0 X-SA-Exim-Connect-IP: 192.168.0.2 X-SA-Exim-Mail-From: linux@youmustbejoking.demon.co.uk X-SA-Exim-Scanned: No (on pentagram.youmustbejoking.demon.co.uk); SAEximRunCond expanded to false X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2005 23:05:45 -0000 Status: O X-Status: X-Keywords: X-UID: 5297 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. --- 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;