Questions tagged [backup]
39 questions
22
votes
4 answers
Put all backups into one backup folder
How can I set up Emacs so that all backups are placed into one backup folder? e.g. /MyEmacsBackups

programking
- 7,064
- 9
- 41
- 62
12
votes
1 answer
Turn off automatic backups for specific files
For a long time I've had Emacs put backups for all files into a single folder:
(setq backup-directory-alist '(("." . "~/.emacs.d/backups")))
I hardly ever visit the backups directory, but recently I noticed that it contains a lot of *-autoloads.el…

itsjeyd
- 14,586
- 3
- 58
- 87
9
votes
3 answers
Automatic deletion of backup files
When editing files, some foo.bar~ backups appear (files ending with a tilde ~). How can I control their creations, and is it possible to ask for a recursive bulk deletion of all files from a specific directory and all it's sub directories?

smonff
- 1,575
- 1
- 15
- 20
6
votes
1 answer
version control using the usual backup system of Emacs
This question is inspired by https://emacs.stackexchange.com/a/7831/ and the below settings borrowed from that answer :
(setq backup-directory-alist '(("." . "~/emacs-backups"))
version-control 'numbered
make-backup-files t
…

Name
- 7,689
- 4
- 38
- 84
4
votes
2 answers
Backup saved buffers to Dropbox (or other specific directory)
Is it possible to customize Emacs so that whenever I save a file, Emacs also copies it to a specific folder?
This directory could be, for instance, D:\my_backups or C:\Users\username\Dropbox\my_backups.
The copy should have the same name as the…

Name
- 7,689
- 4
- 38
- 84
4
votes
1 answer
How can backup-directory-alist be set to save in the files directory?
I want the backup files to be created in sub-directories of the files being edited, and I have created a function returns that directory.
(defun tempfilepath ()
(interactive)
(concat (file-name-directory buffer-file-name)…

vfclists
- 1,347
- 1
- 11
- 28
4
votes
2 answers
recover backup files
Is there a command for recover the current file from the backup ?
I have a file ~/temp.txt and some backup files !home!djangoliv!temp.txt.~1~ ... !home!djangoliv!temp.txt.~5~, !home!djangoliv!temp.txt.~6~.
I would like to load backup files from the…

djangoliv
- 3,169
- 16
- 31
4
votes
0 answers
Why is renaming (rather than copying) the default way to create backup files?
The documentation on backup file creation, Copying vs. Renaming, makes it sound like copying is the more sensible choice.
file owner and group remain unchanged
hard links remain associated with the actual file rather than its backup
Given that,…

ivan
- 1,928
- 10
- 20
4
votes
1 answer
How to stop auto backup in some directory in Emacs
In general I want Emacs to save a backup file for me, except in some special directories.
I tried to define a Directory Local Variables, and add:
((nil . ((make-backup-files . nil))))
But it seem it won't take effect. I think it is because…

David S.
- 395
- 2
- 13
3
votes
1 answer
How can I back up my init file with Git?
The docs say to keep the .emacs file in the HOME directory.
I'd like to share the file between multiple computers using a git repo. What is the best way to structure the repo without including everything else that's in HOME.
Do I have to turn HOME…

Hugh_Kelley
- 237
- 2
- 11
3
votes
3 answers
How to ignore backup files (~) when running grep?
M-x grep can be used to find strings in files. But I'm not interested in backup files (those whose name ends with a ~).
How should I ignore those files when using the grep command?

DataHungry
- 247
- 1
- 7
3
votes
1 answer
How do I prevent backups of scripts from being made executable?
If I edit an executable script, say foo.sh, then upon saving emacs makes the backup file foo.sh~. That's all well and good, but if the original file has the executable bit set, then so does the backup. This is a little annoying; is there a way to…

greatBigDot
- 153
- 3
2
votes
1 answer
Create versioned backup file on every save into date hierachy
New to Emacs and Lisp. I'm trying to replicate BBEdit's automatic backups, that is:
create a subfolder for each day (2022-11-02)
include the date and time in the backup's filename (2022-11-02 21-45-07-123)
Managed to create one backup file by…

Pete
- 31
- 3
2
votes
1 answer
Emacs backups - why backup all files to a single directory?
I was updating my emacs backup approach using ideas from answers to this question, but I'm left unsure by one aspect, namely: the fact that several of them arrange to have backups placed in a single backup directory. So they might have something…

tkp
- 151
- 5
2
votes
0 answers
How to disable tramp autosave and backups, but keep other backups/autosave?
I'd like to disable autosaves and backups when using tramp, because I neither want to save stuff from remote machines nor stuff belonging to root in my backup/autosave directory. How to do that?
I have read the documentation about tramp autosave and…

Max1
- 141
- 4