From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: deleting backup files dependant on their age Date: Mon, 23 Nov 2015 22:14:55 +0200 Message-ID: <83r3jgzd4w.fsf@gnu.org> References: <874mgcebxk.fsf@skimble.plus.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1448309739 17861 80.91.229.3 (23 Nov 2015 20:15:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Nov 2015 20:15:39 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 23 21:15:29 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a0xW8-0002sq-RG for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Nov 2015 21:15:16 +0100 Original-Received: from localhost ([::1]:34424 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0xW9-0005bS-BV for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Nov 2015 15:15:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40675) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0xVy-0005Xx-0M for help-gnu-emacs@gnu.org; Mon, 23 Nov 2015 15:15:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0xVt-0006h4-2J for help-gnu-emacs@gnu.org; Mon, 23 Nov 2015 15:15:05 -0500 Original-Received: from mtaout26.012.net.il ([80.179.55.182]:36669) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0xVs-0006h0-RY for help-gnu-emacs@gnu.org; Mon, 23 Nov 2015 15:15:01 -0500 Original-Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NYA00F00AXOUC00@mtaout26.012.net.il> for help-gnu-emacs@gnu.org; Mon, 23 Nov 2015 22:17:55 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NYA008S0B1UPT60@mtaout26.012.net.il> for help-gnu-emacs@gnu.org; Mon, 23 Nov 2015 22:17:55 +0200 (IST) In-reply-to: <874mgcebxk.fsf@skimble.plus.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.182 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108205 Archived-At: > From: Sharon Kimble > Date: Mon, 23 Nov 2015 19:46:31 +0000 >=20 > I'm revisiting the age-old problem of deleting backup files, where > currently I have 1,383 which is increasing day-by-day. I have this = in my > init.org - >=20 > --8<---------------cut here---------------start------------->8--- > (setq backup-directory-alist '(("." . "~/.emacs.d/backups/")) > backup-by-copying t > version-control t > delete-old-versions t > kept-new-versions 2 > kept-old-versions 1) > --8<---------------cut here---------------end--------------->8--- >=20 > but it doesn't seem to be deleting the old files. Please show an example of "doesn't seem to be deleting old files". I= t is not clear from this description what you expected this to do and what you actually observe. > --8<---------------cut here---------------start------------->8--- > #+begin_src emacs-lisp > (message "Deleting old backup files...") > (let ((fortnight (* 60 60 24 14)) > (current (float-time (current-time)))) > (dolist (file (directory-files ~/.emacs.d/backups t)) > (when (and (backup-file-name-p file) > (> (- current (float-time (fifth (file-attributes fi= le)))) > fortnight)) > (message "%s" file) > (delete-file file)))) > #+end_src > --8<---------------cut here---------------end--------------->8--- >=20 > but its failing to work, saying this - >=20 > =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > =E2=94=82Symbol's value as variable is void: ~/.emacs.d/backups > =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 It should be a string, in quotes.