help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: deleting backup files dependant on their age


From: Eli Zaretskii
Subject: Re: deleting backup files dependant on their age
Date: Mon, 23 Nov 2015 22:14:55 +0200

> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]