From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: Out-of-control backups! Date: Mon, 11 Aug 2014 14:47:31 +0200 Message-ID: <87ha1j9org.fsf@thinkpad-t440p.tsdh.org> References: <87wqafnreh.fsf@skimble.plus.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1407761475 26148 80.91.229.3 (11 Aug 2014 12:51:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2014 12:51:15 +0000 (UTC) Cc: help-gnu-emacs To: Sharon Kimble Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 11 14:51:08 2014 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 1XGp43-0003dy-J5 for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Aug 2014 14:51:03 +0200 Original-Received: from localhost ([::1]:35530 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGp43-0001Lr-6q for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Aug 2014 08:51:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGp3e-0001Iy-QA for help-gnu-emacs@gnu.org; Mon, 11 Aug 2014 08:50:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGp3X-0008P2-Nv for help-gnu-emacs@gnu.org; Mon, 11 Aug 2014 08:50:38 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:55471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGp3X-0008Or-7s for help-gnu-emacs@gnu.org; Mon, 11 Aug 2014 08:50:31 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 8F5553D64B2; Mon, 11 Aug 2014 14:50:25 +0200 (CEST) X-Virus-Scanned: amavisd-new at uni-koblenz.de Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9-o6LleuWKVk; Mon, 11 Aug 2014 14:50:25 +0200 (CEST) X-CHKRCPT: Envelopesender noch tsdh@gnu.org Original-Received: from thinkpad-t440p.tsdh.org (dhcp179.uni-koblenz.de [141.26.71.179]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 6E1B73D64CA; Mon, 11 Aug 2014 14:49:52 +0200 (CEST) In-Reply-To: <87wqafnreh.fsf@skimble.plus.com> (Sharon Kimble's message of "Mon, 11 Aug 2014 13:26:46 +0100") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 141.26.64.15 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:99161 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Sharon Kimble writes: Hi Sharon, > I need help with regard to my backups please. This is my relevant > section of my 'init.el' > > --8<---------------cut here---------------start------------->8--- > ;; Save backup files in a dedicated directory > (setq backup-directory-alist '(("." . "~/.emacs.d/backup"))) > --8<---------------cut here---------------end--------------->8--- > > Currently I have 38 backups of my 'custom.el', and 60 backups of my > 'init.el', and a total of 9,941 files, which just shows the extent of > the problem! There's no too safe! ;-) > How can I get it to just save 7 backups for each file and then delete > the rest please? Have a look at the following variables: ,----[ C-h v version-control RET ] | version-control is a variable defined in `files.el'. | Its value is t | Original value was nil |=20 | This variable is safe as a file local variable if its value | satisfies the predicate which is a byte-compiled expression. |=20 | Documentation: | Control use of version numbers for backup files. | When t, make numeric backup versions unconditionally. | When nil, make them for files that have some already. | The value `never' means do not make them. `---- ,----[ C-h v delete-old-versions RET ] | delete-old-versions is a variable defined in `files.el'. | Its value is t | Original value was nil |=20 | Documentation: | If t, delete excess backup versions silently. | If nil, ask confirmation. Any other value prevents any trimming. `---- ,----[ C-h v kept-old-versions RET ] | kept-old-versions is a variable defined in `files.el'. | Its value is 0 | Original value was 2 |=20 | This variable is safe as a file local variable if its value | satisfies the predicate `integerp'. |=20 | Documentation: | Number of oldest versions to keep when a new numbered backup is made. `---- ,----[ C-h v kept-new-versions RET ] | kept-new-versions is a variable defined in `files.el'. | Its value is 15 | Original value was 2 |=20 | This variable is safe as a file local variable if its value | satisfies the predicate `integerp'. |=20 | Documentation: | Number of newest versions to keep when a new numbered backup is made. | Includes the new backup. Must be > 0 `---- If you have numbered backups, then you've set `version-control' to t already. As you can see from the `delete-old-versions' default value, Emacs doesn't delete backups if not configured to do so. And if you set it to t, it'll keep the first two and the last two versions of each file. With my settings, it just keeps the 15 most recent versions. So all in all, =2D-8<---------------cut here---------------start------------->8--- (setq version-control t delete-old-versions t kept-new-versions 7 kept-old-versions 0 backup-directory-alist '(("." . "~/.emacs.d/backups/"))) =2D-8<---------------cut here---------------end--------------->8--- is probably what you are looking for. HTH, Tassilo --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREIAAYFAlPou2MACgkQ795mVA/1wV33QAD/XKYTZEUqHPMkF3Uv44qL4VoH pwe6uy1SgcFmFXWgvGMBAK37hg0+MCRGLERFPMUliKiWoZZ/JiZKuph/ytzCte0o =ptRf -----END PGP SIGNATURE----- --=-=-=--