snapshot.texi 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. @c This is part of the paxutils manual.
  2. @c Copyright (C) 2005, 2007 Free Software Foundation, Inc.
  3. @c Written by Sergey Poznyakoff
  4. @c This file is distributed under GFDL 1.1 or any later version
  5. @c published by the Free Software Foundation.
  6. A @dfn{snapshot file} (or @dfn{directory file}) is created during
  7. incremental backups (@pxref{Incremental Dumps}). It
  8. contains the status of the file system at the time of the dump and is
  9. used to determine which files were modified since the last backup.
  10. @GNUTAR{} version @value{VERSION} supports three snapshot file
  11. formats. The first format, called @dfn{format 0}, is the one used by
  12. @GNUTAR{} versions up to 1.15.1. The second format, called @dfn{format
  13. 1} is an extended version of this format, that contains more metadata
  14. and allows for further extensions. It was used by version
  15. 1.15.1. Starting from version 1.16 and up to @value{VERSION}, the
  16. @dfn{format 2} is used.
  17. @GNUTAR{} is able to read all three formats, but will create
  18. snapshots only in format 2.
  19. This appendix describes all three formats in detail.
  20. @enumerate 0
  21. @cindex format 0, snapshot file
  22. @cindex snapshot file, format 0
  23. @item
  24. @samp{Format 0} snapshot file begins with a line containing a
  25. decimal number that represents a @acronym{UNIX} timestamp of the
  26. beginning of the last archivation. This line is followed by directory
  27. metadata descriptions, one per line. Each description has the
  28. following format:
  29. @smallexample
  30. @var{nfs}@var{dev} @var{inode} @var{name}
  31. @end smallexample
  32. @noindent
  33. where:
  34. @table @var
  35. @item nfs
  36. A single plus character (@samp{+}), if this directory is located on
  37. an @acronym{NFS}-mounted partition, or a single space otherwise;
  38. @item dev
  39. Device number of the directory;
  40. @item inode
  41. I-node number of the directory;
  42. @item name
  43. Name of the directory. Any special characters (white-space,
  44. backslashes, etc.) are quoted.
  45. @end table
  46. @cindex format 1, snapshot file
  47. @cindex snapshot file, format 1
  48. @item
  49. @samp{Format 1} snapshot file begins with a line specifying the
  50. format of the file. This line has the following structure:
  51. @smallexample
  52. @samp{GNU tar-}@var{tar-version}@samp{-}@var{incr-format-version}
  53. @end smallexample
  54. @noindent
  55. where @var{tar-version} is the version number of @GNUTAR{}
  56. implementation that created this snapshot, and
  57. @var{incr-format-version} is the version number of the snapshot format
  58. (in this case @samp{1}).
  59. Next line contains two decimal numbers, representing the
  60. time of the last backup. First number is the number of seconds, the
  61. second one is the number of nanoseconds, since the beginning of the
  62. epoch.
  63. Lines that follow contain directory metadata, one line per
  64. directory. Each line is formatted as follows:
  65. @smallexample
  66. [@var{nfs}]@var{mtime-sec} @var{mtime-nsec} @var{dev} @var{inode} @var{name}
  67. @end smallexample
  68. @noindent
  69. where @var{mtime-sec} and @var{mtime-nsec} represent last
  70. modification time of this directory with nanosecond precision;
  71. @var{nfs}, @var{dev}, @var{inode} and @var{name} have the same meaning
  72. as with @samp{format 0}.
  73. @cindex format 2, snapshot file
  74. @cindex snapshot file, format 2
  75. @item
  76. @FIXME{}
  77. A snapshot file begins with a format identifier, as described for
  78. version 1, e.g.:
  79. @smallexample
  80. GNU tar-@value{VERSION}-2
  81. @end smallexample
  82. This line is followed by newline. Rest of file consists of
  83. records, separated by null (@acronym{ASCII} 0)
  84. characters. Thus, in contrast to the previous formats, format 2
  85. snapshot is a binary file.
  86. First two records are decimal numbers, representing the
  87. time of the last backup. First number is the number of seconds, the
  88. second one is the number of nanoseconds, since the beginning of the
  89. epoch. These are followed by arbitrary number of directory records.
  90. Each @dfn{directory record} contains a set of metadata describing a
  91. particular directory. Parts of a directory record are delimited with
  92. @acronym{ASCII} 0 characters. The following table describes each
  93. part. The @dfn{Number} type in this table stands for a decimal number
  94. in @acronym{ASCII} notation.
  95. @multitable @columnfractions 0.2 0.2 0.6
  96. @headitem Field @tab Type @tab Description
  97. @item nfs @tab Character @tab @samp{1} if the directory is located on
  98. an @acronym{NFS}-mounted partition, or @samp{0} otherwise;
  99. @item mtime-sec @tab Number @tab Modification time, seconds;
  100. @item mtime-nano @tab Number @tab Modification time, nanoseconds;
  101. @item dev-no @tab Number @tab Device number;
  102. @item i-no @tab Number @tab I-node number;
  103. @item name @tab String @tab Directory name; In contrast to the
  104. previous versions it is not quoted.
  105. @item contents @tab Dumpdir @tab Contents of the directory;
  106. @xref{Dumpdir}, for a description of its format.
  107. @item
  108. @end multitable
  109. Dumpdirs stored in snapshot files contain only records of types
  110. @samp{Y}, @samp{N} and @samp{D}.
  111. @end enumerate
  112. @c End of snapshot.texi