4

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, why does the default behavior prefer renaming in most cases?

  • backup-by-copying defaults to nil
  • backup-by-copying-when-linked defaults to nil
  • backup-by-copying-when-mismatch defaults to t
ivan
  • 1,928
  • 10
  • 20
  • 1
    This probably relates to how some file-systems treat copying and renaming. Some file-systems may use file-level deduplication, in which case no new data will be written in case of renaming, but will in case of copying... (this is just a guess). But then this isn't really very useful for backups... I think, it's best not to rely on defaults and choose the strategy after reading file-system documentation. – wvxvw Sep 24 '16 at 19:00
  • 2
    I guess for efficiency: copying has to write the file contents twice, renaming only once (see docstring of `make-backup-files`). – npostavs Sep 25 '16 at 14:31

0 Answers0