all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Out-of-control backups!
@ 2014-08-11 12:26 Sharon Kimble
  2014-08-11 12:47 ` Tassilo Horn
       [not found] ` <mailman.6967.1407761447.1147.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Sharon Kimble @ 2014-08-11 12:26 UTC (permalink / raw
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 787 bytes --]

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!

How can I get it to just save 7 backups for each file and then delete
the rest please?

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
my git repo = https://bitbucket.org/boudiccas/dots
TGmeds = http://www.tgmeds.org.uk
Debian testing, fluxbox 1.3.5, emacs 24.3.92.1

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Out-of-control backups!
  2014-08-11 12:26 Out-of-control backups! Sharon Kimble
@ 2014-08-11 12:47 ` Tassilo Horn
       [not found] ` <mailman.6967.1407761447.1147.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Tassilo Horn @ 2014-08-11 12:47 UTC (permalink / raw
  To: Sharon Kimble; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 3040 bytes --]

Sharon Kimble <boudiccas@skimble.plus.com> 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
| 
|   This variable is safe as a file local variable if its value
|   satisfies the predicate which is a byte-compiled expression.
| 
| 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
| 
| 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
| 
|   This variable is safe as a file local variable if its value
|   satisfies the predicate `integerp'.
| 
| 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
| 
|   This variable is safe as a file local variable if its value
|   satisfies the predicate `integerp'.
| 
| 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,

--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/")))
--8<---------------cut here---------------end--------------->8---

is probably what you are looking for.

HTH,
Tassilo

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 212 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Out-of-control backups!
       [not found] ` <mailman.6967.1407761447.1147.help-gnu-emacs@gnu.org>
@ 2014-08-19  3:17   ` Hans BKK
  2014-08-19  3:33     ` Rusi
  0 siblings, 1 reply; 10+ messages in thread
From: Hans BKK @ 2014-08-19  3:17 UTC (permalink / raw
  To: help-gnu-emacs

> Sharon Kimble writes:
> > I need help with regard to my backups please. This is my relevant
> > section of my 'init.el'

I thought keeping config files in a version control system like github was standard practice?


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Out-of-control backups!
  2014-08-19  3:17   ` Hans BKK
@ 2014-08-19  3:33     ` Rusi
  2014-08-19 16:53       ` Emanuel Berg
  0 siblings, 1 reply; 10+ messages in thread
From: Rusi @ 2014-08-19  3:33 UTC (permalink / raw
  To: help-gnu-emacs

On Tuesday, August 19, 2014 8:47:33 AM UTC+5:30, Hans BKK wrote:
> > Sharon Kimble writes:
> > > I need help with regard to my backups please. This is my relevant
> > > section of my 'init.el'

> I thought keeping config files in a version control system like github was standard practice?

Including bank passwords??

[Ok only joking...]

More seriously, yes configs in a VCS is a good idea but as yet very emergent;
not at all 'standard practice'

Some tools (linux) in this area that are worth looking at
- etckeeper
- myrepos
- vcsh

[I know Ive to start using (one of these)... Not yet got round to it]


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Out-of-control backups!
  2014-08-19  3:33     ` Rusi
@ 2014-08-19 16:53       ` Emanuel Berg
  2014-08-20  6:20         ` Tassilo Horn
       [not found]         ` <mailman.7267.1408515668.1147.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Emanuel Berg @ 2014-08-19 16:53 UTC (permalink / raw
  To: help-gnu-emacs

Rusi <rustompmody@gmail.com> writes:

> More seriously, yes configs in a VCS is a good idea
> but as yet very emergent; not at all 'standard
> practice'

It may be a lousy idea as well to bring in all that
bulky overhead. It is just a bunch of files. Your whole
system is a bunch of files. Why don't we VCS that as
well and be done with it? So we can spend our lives
fiddling with overhead, "management" software and draw
UML boxes on whiteboards and have meetings so we never
have to actually write that scary code?

-- 
underground experts united


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Out-of-control backups!
  2014-08-19 16:53       ` Emanuel Berg
@ 2014-08-20  6:20         ` Tassilo Horn
  2014-08-20 13:52           ` Stefan Monnier
       [not found]         ` <mailman.7267.1408515668.1147.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 10+ messages in thread
From: Tassilo Horn @ 2014-08-20  6:20 UTC (permalink / raw
  To: help-gnu-emacs

Emanuel Berg <embe8573@student.uu.se> writes:

>> More seriously, yes configs in a VCS is a good idea
>> but as yet very emergent; not at all 'standard
>> practice'
>
> It may be a lousy idea as well to bring in all that
> bulky overhead. It is just a bunch of files. Your whole
> system is a bunch of files. Why don't we VCS that as
> well and be done with it? So we can spend our lives
> fiddling with overhead, "management" software and draw
> UML boxes on whiteboards and have meetings so we never
> have to actually write that scary code?

Well, config files (especially the allmighty ~/.emacs and ~/.gnus.el)
might be worth the extra management effort.  At least I don't want to
lose them when my harddrive passes away.

Of course, you could make backups (to external drives).  But as far as
I'm concerned, I know I won't do that regularly if at all.

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Out-of-control backups!
  2014-08-20  6:20         ` Tassilo Horn
@ 2014-08-20 13:52           ` Stefan Monnier
  2014-08-20 15:11             ` Tassilo Horn
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2014-08-20 13:52 UTC (permalink / raw
  To: help-gnu-emacs

> Of course, you could make backups (to external drives).  But as far as
> I'm concerned, I know I won't do that regularly if at all.

The idea that someone might do backups manually baffles me,


        Stefan




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Out-of-control backups!
  2014-08-20 13:52           ` Stefan Monnier
@ 2014-08-20 15:11             ` Tassilo Horn
  2014-08-20 16:41               ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: Tassilo Horn @ 2014-08-20 15:11 UTC (permalink / raw
  To: Stefan Monnier; +Cc: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Of course, you could make backups (to external drives).  But as far
>> as I'm concerned, I know I won't do that regularly if at all.
>
> The idea that someone might do backups manually baffles me,

No, back then when I did make backups I automated that using a cron job
that checked if my external HDD was connected, and if so, do an
incremental backup.  But that didn't work too well for two reasons.  1)
I simply didn't get to my external HDD too often, and 2) I accidentally
backed up large new files that weren't covered by my black/whitelists
and globs.  Then I either could just wait for the file copy to finish,
or abort the backup, edit my blacklist and backup again.

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Out-of-control backups!
  2014-08-20 15:11             ` Tassilo Horn
@ 2014-08-20 16:41               ` Stefan Monnier
  0 siblings, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2014-08-20 16:41 UTC (permalink / raw
  To: help-gnu-emacs

> No, back then when I did make backups I automated that using a cron job
> that checked if my external HDD was connected, and if so, do an
> incremental backup.  But that didn't work too well for two reasons.  1)
> I simply didn't get to my external HDD too often, and 2) I accidentally
> backed up large new files that weren't covered by my black/whitelists
> and globs.  Then I either could just wait for the file copy to finish,
> or abort the backup, edit my blacklist and backup again.

I have a daily cronjob that backs up to my home server.  No need to
physically connect a drive: as long as I'm connected to my home network,
the backup can take place.

Plus, I can access my backup any time remotely ;-)


        Stefan




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Out-of-control backups!
       [not found]         ` <mailman.7267.1408515668.1147.help-gnu-emacs@gnu.org>
@ 2014-08-20 17:34           ` Emanuel Berg
  0 siblings, 0 replies; 10+ messages in thread
From: Emanuel Berg @ 2014-08-20 17:34 UTC (permalink / raw
  To: help-gnu-emacs

Tassilo Horn <tsdh@gnu.org> writes:

> Well, config files (especially the allmighty ~/.emacs
> and ~/.gnus.el) might be worth the extra management
> effort. At least I don't want to lose them when my
> harddrive passes away.

Yeah, I have some 50 files of Elisp and as many with
zsh functions and a big chunk with everything else as
well, if all that disappeared that would be a black day
indeed. So I use rsync to beam it to a safe space
regularly. I'm not opposed backups, I just think
version control with branching and commits and all
isn't called for. Because the code isn't that
interconnected, it doesn't break and experimentation in
one direction that needs to be isolated doesn't happen.
Only if you are very used to do it from other projects
you may include that activity to your config files with
so little effort, then it is another matter, of course.

-- 
underground experts united


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-08-20 17:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-11 12:26 Out-of-control backups! Sharon Kimble
2014-08-11 12:47 ` Tassilo Horn
     [not found] ` <mailman.6967.1407761447.1147.help-gnu-emacs@gnu.org>
2014-08-19  3:17   ` Hans BKK
2014-08-19  3:33     ` Rusi
2014-08-19 16:53       ` Emanuel Berg
2014-08-20  6:20         ` Tassilo Horn
2014-08-20 13:52           ` Stefan Monnier
2014-08-20 15:11             ` Tassilo Horn
2014-08-20 16:41               ` Stefan Monnier
     [not found]         ` <mailman.7267.1408515668.1147.help-gnu-emacs@gnu.org>
2014-08-20 17:34           ` Emanuel Berg

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.