GNU Emacs Manual. Node: Backup Deletion

PREVBackup Names UPBackup NEXTBackup Copying Automatic Deletion of Backups

To prevent unlimited consumption of disk space, Emacs can delete numbered backup versions automatically. Generally Emacs keeps the first few backups and the latest few backups, deleting any in between. This happens every time a new backup is made.

The two variables kept-old-versions and kept-new-versions control this deletion. Their values are, respectively the number of oldest (lowest-numbered) backups to keep and the number of newest (highest-numbered) ones to keep, each time a new backup is made. Recall that these values are used just after a new backup version is made; that newly made backup is included in the count in kept-new-versions. By default, both variables are 2.

If delete-old-versions is non-nil, the excess middle versions are deleted without a murmur. If it is nil, the default, then you are asked whether the excess middle versions should really be deleted.

Dired's . (Period) command can also be used to delete old versions. See Dired Deletion.

PREVBackup Names UPBackup NEXTBackup Copying