bill@green.bph.jhu.edu (Bill Bogstad) (01/06/89)
A number of people have been questioning whether or not GNU tar can really be used for incremental file system backups. Below I provide the GNU documentation for their "-G" option which seems to fit the bill. They also have -M (multi-volume) and -V (volume header) options. For creation `-G' This option should only be used when creating an incremental backup of a filesystem. When the `-G' option is used, `tar' writes at the beginning of the archive an entry for each of the directories that will be operated on. The entry for a directory includes a list of all the files in the directory at the time the dump was done, and a flag for each file indicating whether the file is going to be put in the archive. This information is used when doing a complete incremental restore. For extraction `-G' The `-G' option means the archive is an incremental backup. Its meaning depends on the command that it modifies. If the `-G' option is used with `-t', `tar' will list, for each directory in the archive, the list of files in that directory at the time the archive was created. This information is put out in a format that is not easy for humans to read, but which is unambiguous for a program: each filename is preceded by either a `Y' if the file is present in the archive, or an `N' if the file is a directory, or is not included in the archive. Each filename is terminated by a null character. The last file is followed by an additional null and a newline to indicate the end of the data. If the `-G' option is used with `-x', then when the entry for a directory is found, all files that currently exist in that directory but are not listed in the archive *are deleted from the directory*. This behavior is convenient when you are restoring a damaged file system from a succession of incremental backups: it restores the entire state of the file system to that which obtained when the backup was made. If you don't use `-G', the file system will probably fill up with files that shouldn't exist any more. Bill Bogstad bogstad@crabcake.cs.jhu.edu