From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: deleting backup files dependant on their age
Date: Mon, 23 Nov 2015 22:14:55 +0200 [thread overview]
Message-ID: <83r3jgzd4w.fsf@gnu.org> (raw)
In-Reply-To: <874mgcebxk.fsf@skimble.plus.com>
> From: Sharon Kimble <boudiccas@skimble.plus.com>
> Date: Mon, 23 Nov 2015 19:46:31 +0000
>
> 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 -
>
> --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---
>
> but it doesn't seem to be deleting the old files.
Please show an example of "doesn't seem to be deleting old files". It
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 file))))
> fortnight))
> (message "%s" file)
> (delete-file file))))
> #+end_src
> --8<---------------cut here---------------end--------------->8---
>
> but its failing to work, saying this -
>
> ╭────
> │Symbol's value as variable is void: ~/.emacs.d/backups
> ╰────
It should be a string, in quotes.
next prev parent reply other threads:[~2015-11-23 20:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-23 19:46 deleting backup files dependant on their age Sharon Kimble
2015-11-23 20:14 ` Eli Zaretskii [this message]
2015-11-24 0:01 ` Emanuel Berg
2015-11-24 0:58 ` Emanuel Berg
[not found] ` <mailman.585.1448326084.31583.help-gnu-emacs@gnu.org>
2015-11-24 4:46 ` Dan Espen
2015-11-25 1:26 ` Emanuel Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83r3jgzd4w.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.