From patchwork Wed Oct 5 20:02:51 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Salt X-Patchwork-Id: 12056 Received: from anchor-post-33.mail.demon.net ([194.217.242.91]) by www.linuxtv.org with esmtp (Exim 4.50) id 1ENFnK-0004WV-8L for vdr@linuxtv.org; Wed, 05 Oct 2005 22:23:18 +0200 Received: from youmustbejoking.demon.co.uk ([212.228.127.8] helo=pentagram.youmustbejoking.demon.co.uk) by anchor-post-33.mail.demon.net with esmtp (Exim 4.42) id 1ENFnF-000IBx-Cd for vdr@linuxtv.org; Wed, 05 Oct 2005 20:23:15 +0000 Received: from [192.168.0.2] (helo=riscpc) by pentagram.youmustbejoking.demon.co.uk with esmtp (Exim 4.50) id 1ENFnE-0006Pj-Hg for vdr@linuxtv.org; Wed, 05 Oct 2005 21:23:12 +0100 Date: Wed, 05 Oct 2005 21:02:51 +0100 From: Darren Salt To: vdr@linuxtv.org Subject: Re: AW: [vdr] Cleanup Thread (like .update) Message-ID: <4DB53CB822%linux@youmustbejoking.demon.co.uk> References: In-Reply-To: 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: Wed, 4418 Sep 1993 21:02:51 +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: Wed, 05 Oct 2005 20:23:18 -0000 Status: O X-Status: X-Keywords: X-UID: 5348 I demand that hgm.bg may or may not have written... > vdr-bounces@linuxtv.org wrote: >>> #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. > Okay, i will try this, thx It turns out that that one contained a stupid bug - it'd default to 54 minutes, not six. See attached. (BTW, fix your subject prefix or we'll get long "Re: AW:" strings...) Klaus: are you deliberately using > rather than >= in the removal time checks in RemoveDeletedRecordings()? --- vdr-1.3.34~/recording.c +++ vdr-1.3.34/recording.c @@ -62,10 +62,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; @@ -743,6 +743,7 @@ } isyslog("deleting recording %s", FileName()); result = RenameVideoFile(FileName(), NewName); + LastRemoveCheck = time(NULL) - REMOVECHECKDELTA + max (60, REMOVECHECKDELTA / 10); } free(NewName); return result;