Archive bit

The archive bit is a file attribute used by Microsoft operating systems, by OS/2 and by AmigaOS. Typically its state indicates whether or not the file has been backed up, in other words archived.

Usage

On Windows and OS/2, when a file is created or modified, the archive bit is set, and when the file has been backed up, the archive bit is cleared. Thus, the meaning of the archive bit is: this file is due for archiving, or: this file has not been archived.

An incremental backup task may use the archive bit to distinguish which files have already been backed up, and select only the new or modified files for backup.

Backup software may provide the option to do a full backup while clearing archive bits – that is, to back up all files regardless of their archive bit status, and to clear the archive bit of all files processed by the backup. This allows for the creation of an initial full backup that will be supplemented by incremental backups in the future.

The operating system never clears the archive bit on its own, unless explicitly told to do so by the user. Even when a user explicitly tells the operating system to copy a file for the purpose of archiving the file, the archive bit will still not be cleared. A specific command for clearing (or setting) the bit must be executed. In MS-DOS as well as nearly all versions of Windows, the archive bit can be seen or changed with the attrib command-line utility, or by viewing the properties of a given file with the Windows shell or Windows Explorer. The archive bit can also be seen or changed with the GetFileAttributes, GetFileAttributesEx and SetFileAttributes Windows APIs. The archive bit can also be set or cleared with the attributes property using VBScript or JScript.

When a file with a clear archive bit is moved from one place on a file system to another, the archive bit reverts to being set.

Typically, on a computer system that has never been backed up in a manner that clears archive bits, all files on that computer will have their archive bits set, as there are few applications that make use of archive bits without the user's request.

As the archive bit is a file attribute and not part of the file itself, the contents of the file are unrelated to the status of the archive bit and remain unchanged even if the setting of the archive bit is changed.

Alternatives

Relying on the archive bit for backing up files can be unreliable if multiple backup programs are setting and clearing the attribute bit on the same volume. Another possibility is to use the timestamp of the last change to the file or directory. This is typically the technique used in UNIX-like operating systems.

See also

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.