Backup copy

from Wikipedia, the free encyclopedia

A backup is the copy of an older version of a file or document that many application programs automatically create when you save your work.

Backup copies are often characterized by special file extensions such as. B. BAK, which are partly appended to the original file name with an extension, partly replace the original extension. The purpose of these backup copies is to prevent data loss due to accidental storage. The quite simple procedure can be seen as a minimalist variant of versioning .

Some applications allow the user to determine the extension or the storage location himself or to switch off the creation of backup copies completely.

Technical background

In the programming of applications , it is usually necessary to store a rather complex structure of a document in a file; software errors can lead to the generation of a file failing. A backup copy is also useful in these cases.

For documents with a simple structure, it is common practice to save the target file directly under the original name after renaming the source file; In the case of more complex documents, an output is initially generated temporarily , which - if successfully completed - is renamed to the original file name after a copy of the original file has been saved as a backup copy under a slightly different name.

Typical labeling methods

Traditionally (e.g. in the case of Turbo Pascal or Turbo C ) the ending of the original file was replaced by the ending bakor old. This sometimes caused difficulties, because as soon as naming conventions exist, as in the case of translation units of C or C ++ files, where pairing of files is normal, a replacement in the long term inevitably destroys the contents of one of the two files. It is now common to append endings (as in the example of WinMerge ) or to store them under the original name in places specified for backup copies (e.g. in the case of the CONText editor ).