home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / targzip.zip / Docs / TAR.INF (.txt) < prev   
OS/2 Help File  |  1993-04-10  |  43KB  |  1,149 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. -Preface- ΓòÉΓòÉΓòÉ
  3.  
  4. This file documents the tape archive of the GNU system. 
  5.  
  6. Copyright (C) 1988 Free Software Foundation, Inc. 
  7.  
  8. Permission is granted to make and distribute verbatim copies of this manual 
  9. provided the copyright notice and this permission notice are preserved on all 
  10. copies. 
  11.  
  12. Permission is granted to copy and distribute modified versions of this manual 
  13. under the conditions for verbatim copying, provided that the entire resulting 
  14. derived work is distributed under the terms of a permission notice identical to 
  15. this one. 
  16.  
  17. Permission is granted to copy and distribute translations of this manual into 
  18. another language, under the above conditions for modified versions. 
  19.  
  20.  
  21. ΓòÉΓòÉΓòÉ 2. Preface ΓòÉΓòÉΓòÉ
  22.  
  23.  This manual describes the GNU tape archiver, tar, and how you can use it to 
  24.  store copies of a file or a group of files in an archive.  This archive may be 
  25.  written directly to a magnetic tape or other storage medium, stored as a file, 
  26.  or sent through a pipe to another program.  tar can also be used to add files 
  27.  to an already existing archive, list the files in an archive, or extract the 
  28.  files in the archive. 
  29.  
  30.  GNU tar was written by John Gilmore, and modified by many people.  The GNU 
  31.  enhancements were written by Jay Fenlason. 
  32.  
  33.   Using the Tape Archiver 
  34.  
  35.  You can use the GNU tape archiver, tar, to store copies of a file or a group 
  36.  of files in an archive.  This archive may be written directly to a magnetic 
  37.  tape or other storage medium, stored as a file, or sent through a pipe to 
  38.  another program.  tar can also be used to add files to an already existing 
  39.  archive, list the files in an archive, or extract the files in the archive. 
  40.  
  41.  Why                           What tar archives are good for. 
  42.  Commands                      How to tell tar what to do. 
  43.  Options                       Options that change the way tar behaves. 
  44.  FullDumps                     Using tar to perform full dumps. 
  45.  IncDumps                      Using tar to perform incremental dumps. 
  46.  Problems                      Common problems using tar. 
  47.  Rem Tape                      The remote tape server. 
  48.  Format                        The format of a tar archive. 
  49.  
  50.  
  51. ΓòÉΓòÉΓòÉ 3. The Uses of Tape Archives ΓòÉΓòÉΓòÉ
  52.  
  53.  The tape archiver tar allows you to store many files in an archive file or tar 
  54.  file which describes the names and contents of the constituent files.  Later 
  55.  you can extract some or all of these files from the archive. 
  56.  
  57.  Tar files are not restricted to magnetic tapes.  The tar program can equally 
  58.  well use an ordinary file, or a pipe, or any device, as the archive.  But they 
  59.  were originally designed for use with magnetic tapes, and that is how the name 
  60.  ``tar'' came about. 
  61.  
  62.  Archive files can be used for transporting a group of files from one system to 
  63.  another:  put all relevant files into an archive on one computer system, 
  64.  transfer the archive to another, and extract the contents there.  The basic 
  65.  transfer medium might be magnetic tape, Internet FTP, or even electronic mail 
  66.  (though you must encode the archive with uuencode in order to transport it 
  67.  properly by mail).  Both machines do not have to use the same operating 
  68.  system, as long as they both support the tar program. 
  69.  
  70.  A magnetic tape can store several files in sequence, but has no names for 
  71.  them, just relative position on the tape.  A tar file or something like it is 
  72.  the only way to store several files on one tape and retain their names. Even 
  73.  when the basic transfer mechanism can keep track of names, as FTP can, the 
  74.  nuisance of handling multiple files, directories, and multiple links, may make 
  75.  a tar file a much easier method. 
  76.  
  77.  Archive files are also used for long-term storage, which you can think of as 
  78.  transportation from one time to another. 
  79.  
  80.  Piping one tar to another is an easy way to copy a directory's contents from 
  81.  one disk to another, while preserving the dates, modes, owners and 
  82.  link-structure of all the files therein. 
  83.  
  84.  The GNU version of tar has special features that allow it to be used to make 
  85.  incremental and full dumps of all the files in a filesystem. 
  86.  
  87.  
  88. ΓòÉΓòÉΓòÉ 4. The Different Operations tar Can Perform ΓòÉΓòÉΓòÉ
  89.  
  90.  One program, tar, is used to create an archive, to extract files from an 
  91.  archive, to modify an archive, or to list the contents.  Each time you run 
  92.  tar, you must give a command to specify which one of these things you want to 
  93.  do. 
  94.  
  95.  The command must always be in the first argument to tar.  This argument can 
  96.  also contain options (see Options).  For compatibility with Unix tar, the 
  97.  first argument is always treated as containing command and option letters even 
  98.  if it doesn't start with '-'.  Thus, 'tar c' is equivalent to 'tar -c': both 
  99.  of them specify the '-c' command to create an archive. 
  100.  
  101.  In addition, a set of long-named options are provided which can be used 
  102.  instead of or inter-mixed with the single-letter flags.  The long-named 
  103.  options are meant to be easy to remember and logical, while the single letter 
  104.  flags may not always be.  Long-named options are preceded by a '+'.  In the 
  105.  list of single-letter commands below, each corresponding long-named option is 
  106.  listed next to it, in parentheses. 
  107.  
  108.  The remaining arguments to tar are either options, if they start with '-' or 
  109.  '+', or files to operate on. 
  110.  
  111.  The file names that you give as arguments are the files that tar will act on 
  112.  -- for example, they are the files to put in the archive, or the files to 
  113.  extract from it.  If you don't give any file name arguments, the default 
  114.  depends on which command you used.  Some commands use all relevant files; some 
  115.  commands have no default and will report an error if you don't specify files. 
  116.  
  117.  If a file name argument actually names a directory, then that directory and 
  118.  all files and subdirectories in it are used. 
  119.  
  120.  Here is a list of all the tar commands: 
  121.  
  122.  '-c' 
  123.  
  124.  '+create' This command tells tar to create a new archive that contains the 
  125.            file(s) specified on the command line.  If you don't specify files, 
  126.            all the files in the current directory are used. 
  127.  
  128.            If the archive file already exists, it is overwritten; the old 
  129.            contents are lost. 
  130.  
  131.   '-d'
  132.  
  133.   '+compare'
  134.  
  135.  '+diff'   This command causes tar to compare the archive with the files in the 
  136.            file system.  It will report differences in file size, mode, owner, 
  137.            and contents.  If a file exists in the archive, but not in the file 
  138.            system, tar will report this. 
  139.  
  140.            If you specify file names, those files are compared with the tape 
  141.            and they must all exist in the archive.  If you don't specify files, 
  142.            all the files in the archive are compared. 
  143.  
  144.   '-r'
  145.  
  146.  '+append' This command causes tar to add the specified file(s) to the end of 
  147.            the archive.  This assumes that the archive file already exists and 
  148.            is in the proper format (which probably means it was created 
  149.            previously with the tar program).  If the archive is not in a format 
  150.            that tar understands, the results will be unpredictable. 
  151.  
  152.            You must specify the files to be used; there is no default. 
  153.  
  154.   '-t'
  155.  
  156.  '+list'   This command causes tar to display a list of the files in the 
  157.            archive.  If you specify file names, only the files that you specify 
  158.            will be mentioned (but each of them is mentioned only if it appears 
  159.            in the archive). 
  160.  
  161.   '-u'
  162.  
  163.  '+update' This command causes tar to add the specified files to the end of the 
  164.            archive, like '-r', but only when a file doesn't already exist in 
  165.            the archive or is newer than the version in the archive (the 
  166.            last-modification time is compared).  Adding files to the end of an 
  167.            archive can be very slow. 
  168.  
  169.            You must specify the files to be used; there is no default. 
  170.  
  171.   '-x'
  172.  
  173.   '+extract'
  174.  
  175.  '+get'    This command causes tar to extract the specified files from the 
  176.            archive.  If no file names are given, all the files in the archive 
  177.            will be extracted. 
  178.  
  179.   '-A'
  180.  
  181.   '+catenate'
  182.  
  183.  '+concatenate'This command is used for concatenating several archive files 
  184.            into one big archive file.  The files to operate on should all be 
  185.            archive files. They are all appended to the end of the archive file 
  186.            which tar works on.  (The other files are not changed). 
  187.  
  188.            You might be tempted to use cat for this, but it won't ordinarily 
  189.            work.  A tar archive contains data which indicates the end of the 
  190.            archive, so more material added to the end with cat would be 
  191.            ignored.  This command works because it removes the end-of-archive 
  192.            markers from the middle of the result. 
  193.  
  194.   '-D'
  195.  
  196.  '+delete' This command causes tar to delete the specified files from the 
  197.            archive.  This command is extremely slow.  Warning: Use of this 
  198.            command on archives stored on magnetic tape may result in a 
  199.            scrambled archive. There is no safe way (except for completely 
  200.            re-writing the archive) to delete files from a magnetic tape. 
  201.  
  202.  
  203. ΓòÉΓòÉΓòÉ 5. Options That Change How tar Works ΓòÉΓòÉΓòÉ
  204.  
  205.  Options may be specified as individual arguments starting with '-'. In this 
  206.  case, if the option wants an argument (as does, for example, '-f') then the 
  207.  argument should come after the option, separated from it by a space. All 
  208.  options are optional.  Some options make sense with any command, while others 
  209.  are meaningful only with particular commands. 
  210.  
  211.  General Options               Options that are always meaningful. 
  212.  Creation Options              Options for creating or updating an archive. 
  213.  Extraction Options            Options for listing or extracting files. 
  214.  Option Syntax                 Old syntax for options 
  215.  
  216.  
  217. ΓòÉΓòÉΓòÉ 5.1. Options That Are Always Meaningful ΓòÉΓòÉΓòÉ
  218.  
  219.  '-b number' 
  220.  
  221.  '+block-size number'This option is used to specify a blocking factor for the 
  222.            archive.  When reading or writing the archive, tar, will do reads 
  223.            and writes of the archive in blocks of number*512 bytes. 
  224.  
  225.            The default blocking factor is set when tar is compiled, and is 
  226.            typically 20. 
  227.  
  228.            Blocking factors larger than 20 cannot be read by very old versions 
  229.            of tar, or by some newer versions of tar running on old machines 
  230.            with small address spaces. 
  231.  
  232.            With a magnetic tape, larger blocks give faster throughput and fit 
  233.            more data on a tape (because there are fewer inter-record gaps).  If 
  234.            the archive is in a disk file or a pipe, you may want to specify a 
  235.            smaller blocking factor, since a large one will result in a large 
  236.            number of null bytes at the end of the archive. 
  237.  
  238.            When writing cartridge or other streaming tapes, a much larger 
  239.            blocking factor (say 126 or more) will greatly increase performance. 
  240.            However, you must specify the same blocking factor when reading or 
  241.            updating the archive. 
  242.  
  243.            With GNU tar the blocking factor is limited only by the maximum 
  244.            block size of the device containing the archive, or by the amount of 
  245.            available virtual memory. 
  246.  
  247.  '-f filename'
  248.  
  249.  '+file filename'This option is used to specify the file name of the archive 
  250.            tar works on. 
  251.  
  252.            If this option is not given, but the environment variable TAPE is 
  253.            set, its value is used; otherwise, a default archive name (which was 
  254.            picked when tar was compiled) is used.  The default is normally set 
  255.            up to be the ``first'' tape drive or other transportable I/O medium 
  256.            on the system. 
  257.  
  258.            If the filename is '-', tar reads the archive from standard input 
  259.            (when listing or extracting), or writes it to standard output (when 
  260.            creating).  If the '-' filename is given when updating an archive, 
  261.            tar will read the original archive from its standard input, and will 
  262.            write the entire new archive to its standard output. 
  263.  
  264.            If the filename contains ':/dev/', it is interpreted as 
  265.            'hostname:filename'.  If the hostname contains an ``at'' sign ('@'), 
  266.            it is treated as 'user@hostname:filename'. In either case, tar will 
  267.            invoke the command rsh (or remsh) to start up an /etc/rmt on the 
  268.            remote machine.  If you give an alternate login name, it will be 
  269.            given to the rsh.  Naturally, the remote machine must have a copy of 
  270.            '/etc/rmt'.  /etc/rmt is free software from the University of 
  271.            California, and a copy of the source code can be found with the 
  272.            sources for tar.  /etc/rmt will have to be modified to run on 
  273.            non-BSD4.3 systems. 
  274.  
  275.  '-C dir'
  276.  
  277.  '+directory dir'This option causes tar to change into the directory dir before 
  278.            continuing.  This option is usually interspersed with the files tar 
  279.            is to work on.  For example, 
  280.  
  281.  
  282.                       tar -c iggy ziggy -C baz melvin
  283.  
  284.  will place the files 'iggy' and 'ziggy' from the current directory on the 
  285.  tape, followed by the file 'melvin' from the directory 'baz'.  This option is 
  286.  especially useful when you have several widely separated files that you want 
  287.  to store in the same directory in the archive. 
  288.  
  289.  Note that the file 'melvin' is recorded in the archive under the precise name 
  290.  'melvin', not 'baz/melvin'.  Thus, the archive will contain three files that 
  291.  all appear to have come from the same directory; if the archive is extracted 
  292.  with plain 'tar -x', all three files will be created in the current directory. 
  293.  
  294.  Contrast this with the command 
  295.  
  296.                       tar -c iggy ziggy bar/melvin
  297.  
  298.  which records the third file in the archive under the name 'bar/melvin' so 
  299.  that, if plain 'tar -x' is used, the third file will be created in a 
  300.  subdirectory named 'bar'. 
  301.  
  302.   '-M'
  303.  
  304.  '+multi-volume'This option causes tar to write a multi-volume archive--one 
  305.            that may be larger than will fit on the medium used to hold it. 
  306.  
  307.            When this option is used, tar will not abort when it cannot read or 
  308.            write any more data.  Instead, it will ask you to prepare a new 
  309.            volume.  If the archive is on a magnetic tape, you should change 
  310.            tapes now; if the archive is on a floppy disk, you should change 
  311.            disks, etc. 
  312.  
  313.            Each volume of a multi-volume archive is an independent tar archive, 
  314.            complete in itself.  For example, you can list or extract any volume 
  315.            alone (just don't specify '-M').  However, if one file in the 
  316.            archive is split across volumes, the only way to extract it 
  317.            successfully is with a multi-volume extract command ('-xM') starting 
  318.            on or before the volume where the file begins. 
  319.  
  320.  '-N date'
  321.  
  322.  '+after-date date'This option causes tar to only work on files whose 
  323.            modification or inode-changed times are newer than the date given. 
  324.            The main use is for creating an archive; then only new files are 
  325.            written.  If extracting, only newer files are extracted. 
  326.  
  327.            Remember that the entire date argument should be quoted if it 
  328.            contains any spaces. 
  329.  
  330.            The date is parsed using getdate. 
  331.  
  332.   '-R'
  333.  
  334.  '+record-number'If '-R' is used, tar prints, along with every message it would 
  335.            normally produce, the record number within the archive where the 
  336.            message occurred.  This option is especially useful when reading 
  337.            damaged archives, since it helps pinpoint the damaged sections. 
  338.  
  339.            This can also be useful when making a log of a file-system backup 
  340.            tape, since the results allow you to find the file you want to 
  341.            retrieve on several backup tapes and choose the tape where the file 
  342.            appears earliest (closest to the front of the tape). 
  343.  
  344.  '-T filename'
  345.  
  346.  '+files-from filename'Instead of taking the list of files to work on from the 
  347.            command line, the list of files to work on is read from the file 
  348.            filename.  If filename is given as '-', the list is read from 
  349.            standard input.  Note that using both '-T -' and '-f -' will not 
  350.            work unless you are using the '-c' command. 
  351.  
  352.   '-v'
  353.  
  354.  '+verbose'This option causes tar to be verbose about the actions it is taking. 
  355.  
  356.            Normally, the '-t' command to list an archive prints just the file 
  357.            names (one per line) and the other commands are silent. 
  358.  
  359.            '-tv' prints a full line of information about each file, like the 
  360.            output of 'ls -l'.  '-v' with any other command (aside from '-t') 
  361.            prints just the name of each file operated on. 
  362.  
  363.            The output from '-v' appears on the standard output except when 
  364.            creating or updating an archive to the standard output, in which 
  365.            case the output from '-v' is sent to the standard error. 
  366.  
  367.             '+version'
  368.  
  369.            This option causes tar to print out its version number to the 
  370.            standard error.  It has no equivalent short option name. 
  371.  
  372.   '-w'
  373.  
  374.  '+interactive'This option causes tar to print a message for each action it 
  375.            intends to take, and ask for confirmation on the terminal.  To 
  376.            confirm, you must type a line of input.  If your input line begins 
  377.            with 'y', the action is performed, otherwise it is skipped. 
  378.  
  379.            The actions which require confirmation include adding a file to the 
  380.            archive, extracting a file from the archive, deleting a file from 
  381.            the archive, and deleting a file from disk. 
  382.  
  383.            If tar is reading the archive from the standard input, tar will open 
  384.            the file '/dev/tty' to ask for confirmation on. 
  385.  
  386.  '-X file'
  387.  
  388.  '+exclude file'This option causes tar to read a list of filename regular 
  389.            expressions, one per line, from the file file; tar will ignore files 
  390.            with those names.  Thus if tar is called as 'tar -c -X foo .' and 
  391.            the file 'foo' contains '*.o' none of the files whose names end in 
  392.            '.o' in the current directory (or any subdirectory of the current 
  393.            directory) will be added to the archive. Multiple -X options may be 
  394.            given. 
  395.  
  396.   '-z'
  397.  
  398.   '-Z'
  399.  
  400.   '+compress'
  401.  
  402.  '+uncompress'The archive should be compressed as it is written, or 
  403.            decompressed as it is read, using the compress program.  This option 
  404.            works on physical devices (tape drives, etc.) and remote files as 
  405.            well as on normal files; data to or from such devices or remote 
  406.            files is reblocked by another copy of the tar program to enforce the 
  407.            specified (or default) block size.  The default compression 
  408.            parameters are used; if you need to override them, avoid the '-z' 
  409.            option and run compress explicitly. 
  410.  
  411.            If the '-z' option is given twice, or the '+compress-block' option 
  412.            is used, tar will pad the archive out to the next block boundry (see 
  413.            General Options).  This may be useful with some devices that require 
  414.            that all write operations be a multiple of a certain size. 
  415.  
  416.            Note that the '-z' option will not work with the '-M' option, or 
  417.            with the '-u', '-r', '-A', or '-D' commands. 
  418.  
  419.  
  420. ΓòÉΓòÉΓòÉ 5.2. Options for Creating Or Updating an Archive ΓòÉΓòÉΓòÉ
  421.  
  422.  These options are used to control which files tar puts in an archive, or to 
  423.  control the format the archive is written in (see Format). 
  424.  
  425.  Except as noted below, these options are useful with the '-c', '-r', '-u', 
  426.  '-A', and '-D' commands. Also note that the '-B' option, (see Extraction 
  427.  Options), is also useful with the '-r', '-u', '-A', and '-D' commands. 
  428.  
  429.  '-G' 
  430.  
  431.  '+incremental'This option should only be used when creating an incremental 
  432.            backup of a filesystem.  When the '-G' option is used, tar writes, 
  433.            at the beginning of the archive, an entry for each of the 
  434.            directories that will be operated on.  The entry for a directory 
  435.            includes a list of all the files in the directory at the time the 
  436.            dump was done, and a flag for each file indicating whether the file 
  437.            is going to be put in the archive.  This information is used when 
  438.            doing a complete incremental restore. 
  439.  
  440.            Note that this option causes tar to create a non-standard archive 
  441.            that may not be readable by non-GNU versions of the tar program. 
  442.  
  443.   '-h'
  444.  
  445.  '+dereference'If '-h' is used, when tar encounters a symbolic link, it will 
  446.            archive the linked-to file, instead of simply recording the presence 
  447.            of a symbolic link.  If the linked-to file is archived again, an 
  448.            entire second copy of it will be archived, instead of a link.  This 
  449.            could be considered a bug. 
  450.  
  451.   '-l'
  452.  
  453.  '+one-file-system'This option causes tar to not cross filesystem boundaries 
  454.            when archiving parts of a directory tree.  This option only affects 
  455.            files that are archived because they are in a directory that is 
  456.            archived; files named on the command line are archived regardless, 
  457.            and they can be from various file systems. 
  458.  
  459.            This option is useful for making full or incremental archival 
  460.            backups of a file system, as with the Unix dump command. 
  461.  
  462.            Files which are skipped due to this option are mentioned on the 
  463.            standard error. 
  464.  
  465.   '-o'
  466.  
  467.   '+old-archive'
  468.  
  469.   '+old'
  470.  
  471.  '+portability'This option causes tar to write an old format archive, which 
  472.            does not include information about directories, pipes, fifos, 
  473.            contiguous files, or device files, and specifies file ownership by 
  474.            numeric user- and group-ids rather than by user and group names.  In 
  475.            most cases, a new format archive can be read by an old tar program 
  476.            without serious trouble, so this option should seldom be needed. 
  477.            When updating an archive, do not use '-o' unless the archive was 
  478.            created with the '-o' option. 
  479.  
  480.   '-S'
  481.  
  482.  '+sparse' This option causes all files to be put in the archive to be tested 
  483.            for sparseness, and handled specially if they are.  The '-S' option 
  484.            is useful when many dbm files, for example, are being backed up, and 
  485.            running out of space on the tape is an issue.  Using this option 
  486.            dramatically decreases the amount of space needed to store such a 
  487.            file. 
  488.  
  489.            In later versions, this option may be removed, and the testing and 
  490.            treatment of sparse files may be done automatically with any special 
  491.            GNU options.  For now, it is an option needing to be specified on 
  492.            the command line with the creation or updating of an archive. 
  493.  
  494.  '-V name'
  495.  
  496.  '+volume name'This option causes tar to write out a volume header at the 
  497.            beginning of the archive.  If '-M' is used, each volume of the 
  498.            archive will have a volume header of 'name Volume N', where N is 1 
  499.            for the first volume, 2 for the next, and so on. 
  500.  
  501.   '-W'
  502.  
  503.  '+verify' This option causes tar to verify the archive after writing it. Each 
  504.            volume is checked after it is written, and any discrepancies are 
  505.            recorded on the standard error output. 
  506.  
  507.            Verification requires that the archive be on a back-space-able 
  508.            medium. This means pipes, some cartridge tape drives, and some other 
  509.            devices cannot be verified. 
  510.  
  511.  
  512. ΓòÉΓòÉΓòÉ 5.3. Options for Listing Or Extracting Files ΓòÉΓòÉΓòÉ
  513.  
  514.  The options in this section are meaningful with the '-x' command. Unless 
  515.  otherwise stated, they are also meaningful with the '-t' command. 
  516.  
  517.  '-B' 
  518.  
  519.  '+read-full-blocks'If '-B' is used, tar will not panic if an attempt to read a 
  520.            block from the archive does not return a full block.  Instead, tar 
  521.            will keep reading until it has obtained a full block. 
  522.  
  523.            This option is turned on by default when tar is reading an archive 
  524.            from standard input, or from a remote machine.  This is because on 
  525.            BSD Unix systems, a read of a pipe will return however much happens 
  526.            to be in the pipe, even if it is less than tar requested.  If this 
  527.            option was not used, tar would fail as soon as it read an incomplete 
  528.            block from the pipe. 
  529.  
  530.            This option is also useful with the commands for updating an 
  531.            archive. 
  532.  
  533.   '-G'
  534.  
  535.  '+incremental'The '-G' option means the archive is an incremental backup. Its 
  536.            meaning depends on the command that it modifies. 
  537.  
  538.            If the '-G' option is used with '-t', tar will list, for each 
  539.            directory in the archive, the list of files in that directory at the 
  540.            time the archive was created.  This information is put out in a 
  541.            format that is not easy for humans to read, but which is unambiguous 
  542.            for a program: each filename is preceded by either a 'Y' if the file 
  543.            is present in the archive, an 'N' if the file is not included in the 
  544.            archive, or a 'D' if the file is a directory (and is included in the 
  545.            archive).  Each filename is terminated by a null character.  The 
  546.            last file is followed by an additional null and a newline to 
  547.            indicate the end of the data. 
  548.  
  549.            If the '-G' option is used with '-x', then when the entry for a 
  550.            directory is found, all files that currently exist in that directory 
  551.            but are not listed in the archive are deleted from the directory. 
  552.  
  553.            This behavior is convenient when you are restoring a damaged file 
  554.            system from a succession of incremental backups: it restores the 
  555.            entire state of the file system to that which obtained when the 
  556.            backup was made. If you don't use '-G', the file system will 
  557.            probably fill up with files that shouldn't exist any more. 
  558.  
  559.   '-i'
  560.  
  561.  '+ignore-zeros'The '-i' option causes tar to ignore blocks of zeros in the 
  562.            archive.  Normally a block of zeros indicates the end of the 
  563.            archive, but when reading a damaged archive, or one which was 
  564.            created by cat-ing several archives together, this option allows tar 
  565.            to read the entire archive.  This option is not on by default 
  566.            because many versions of tar write garbage after the zeroed blocks. 
  567.  
  568.            Note that this option causes tar to read to the end of the archive 
  569.            file, which may sometimes avoid problems when multiple files are 
  570.            stored on a single physical tape. 
  571.  
  572.   '-k'
  573.  
  574.  '+keep-old-files'The '-k' option prevents tar from over-writing existing files 
  575.            with files with the same name from the archive. 
  576.  
  577.            The '-k' option is meaningless with '-t'. 
  578.  
  579.  '-K filename'
  580.  
  581.  '+starting-file filename'The '-K' option causes tar to begin extracting or 
  582.            listing the archive with the file filename, and to consider only the 
  583.            files starting at that point in the archive.  This is useful if a 
  584.            previous attempt to extract files failed when it reached filename 
  585.            due to lack of free space.  (This assumes, of course, that there is 
  586.            now free space, or that you are now extracting into a different file 
  587.            system.) 
  588.  
  589.   '-m'
  590.  
  591.  '+modification-time'When this option is used, tar leaves the modification 
  592.            times of the files it extracts as the time when the files were 
  593.            extracted, instead of setting it to the time recorded in the 
  594.            archive. 
  595.  
  596.            This option is meaningless with '-t'. 
  597.  
  598.   '-O'
  599.  
  600.  '+to-stdout'When this option is used, instead of creating the files specified, 
  601.            tar writes the contents of the files extracted to its standard 
  602.            output.  This may be useful if you are only extracting the files in 
  603.            order to send them through a pipe. 
  604.  
  605.            This option is meaningless with '-t'. 
  606.  
  607.   '-p'
  608.  
  609.   '+same-permissions'
  610.  
  611.  '+preserve-permissions'This option causes tar to set the modes (access 
  612.            permissions) of extracted files exactly as recorded in the archive. 
  613.            If this option is not used, the current umask setting limits the 
  614.            permissions on extracted files. 
  615.  
  616.            This option is meaningless with '-t'. 
  617.  
  618.   '-P'
  619.  
  620.  '+absolute-paths'This option should be used when the absolute pathname of a 
  621.            file should be preserved in the archive.  tar normally strips the 
  622.            leading `/' from the name of the file, thus making /usr/foo/bar/baz 
  623.            into usr/foo/bar/baz.  Using the '-P' option keeps the pathname 
  624.            intact, and is useful in that it is not necessary to change to the 
  625.            root directory when extracting files. 
  626.  
  627.   '-s'
  628.  
  629.   '+same-order'
  630.  
  631.  '+preserve-order'This option tells tar that the list of filenames to be listed 
  632.            or extracted is sorted in the same order as the files in the 
  633.            archive.  This allows a large list of names to be used, even on a 
  634.            small machine that would not otherwise be able to hold all the names 
  635.            in memory at the same time.  Such a sorted list can easily be 
  636.            created by running 'tar -t' on the archive and editing its output. 
  637.  
  638.            This option is probably never needed on modern computer systems. 
  639.  
  640.  '+preserve'The '+preserve' option has no equivalent short option name. It is 
  641.            equivalent to '-p' plus '-s'. 
  642.  
  643.  
  644. ΓòÉΓòÉΓòÉ 5.4. Old Syntax for Options ΓòÉΓòÉΓòÉ
  645.  
  646.  For compatibility with Unix tar, the first argument can contain option letters 
  647.  in addition to the command letter; for example, 'tar cv' specifies the option 
  648.  '-v' in addition to the command '-c'. The first argument to GNU tar is always 
  649.  treated as command and option letters even if it doesn't start with '-'. 
  650.  
  651.  Some options need their own arguments; for example, '-f' is followed by the 
  652.  name of the archive file.  When the option is given separately, its argument 
  653.  follows it, as is usual for Unix programs.  For example: 
  654.  
  655.                       tar -c -v -b 20 -f /dev/rmt0
  656.  
  657.  When options that need arguments are given together with the command, all the 
  658.  associated arguments follow, in the same order as the options.  Thus, the 
  659.  example above could also be written in the old style as follows: 
  660.  
  661.                       tar cvbf 20 /dev/rmt0
  662.  
  663.  Here '20' is the argument of '-b' and '/dev/rmt0' is the argument of '-f'. 
  664.  
  665.  The long-named options can be used instead of the single-letter flags. They 
  666.  are meant to be obvious and easy to remember, possibly more so than their 
  667.  corresponding single-letter options.  The above example using long-named 
  668.  options would look like this: 
  669.  
  670.                       tar +create +verbose +block-size +file 20 /dev/rmt0
  671.  
  672.  
  673. ΓòÉΓòÉΓòÉ 6. Using tar to Perform Full Dumps ΓòÉΓòÉΓòÉ
  674.  
  675.  Full dumps should only be made when no other people or programs are modifying 
  676.  files in the filesystem.  If files are modified while tar is making the 
  677.  backup, they may not be stored properly in the archive, in which case you 
  678.  won't be able to restore them if you have to. 
  679.  
  680.  You will want to use the '-V' option to give the archive a volume label, so 
  681.  you can tell what this archive is even if the label falls off the tape, or 
  682.  anything like that. 
  683.  
  684.  Unless the filesystem you are dumping is guaranteed to fit on one volume, you 
  685.  will need to use the '-M' option.  Make sure you have enough tapes on hand to 
  686.  complete the backup. 
  687.  
  688.  If you want to dump each filesystem separately you will need to use the '-l' 
  689.  option to prevent tar from crossing filesystem boundaries when storing 
  690.  (sub)directories. 
  691.  
  692.  The '-G' option is not needed, since this is a complete copy of everything in 
  693.  the filesystem, and a full restore from this backup would only be done onto a 
  694.  completely empty disk. 
  695.  
  696.  Unless you are in a hurry, and trust the tar program (and your tapes), it is a 
  697.  good idea to use the -W (verify) option, to make sure your files really made 
  698.  it onto the dump properly.  This will also detect cases where the file was 
  699.  modified while (or just after) it was being archived. 
  700.  
  701.  
  702. ΓòÉΓòÉΓòÉ 7. Using tar to Perform Incremental Dumps ΓòÉΓòÉΓòÉ
  703.  
  704.  Performing incremental dumps is similar to performing full dumps, although a 
  705.  few more options will usually be needed. 
  706.  
  707.  You will need to use the '-N date' option to tell tar to only store files that 
  708.  have been modified since date. date should be the date and time of the last 
  709.  full/incremental dump. 
  710.  
  711.  A standard scheme is to do a 'monthly' (full) dump once a month, a 'weekly' 
  712.  dump once a week of everything since the last monthly and a 'daily' every day 
  713.  of everything since the last (weekly or monthly) dump. 
  714.  
  715.  Here is a copy of the script used to dump the filesystems of the machines here 
  716.  at the Free Software Foundation.  This script is run (semi-)automatically late 
  717.  at night when people are least likely to be using the machines.  This script 
  718.  dumps several filesystems from several machines at once (by using a 
  719.  network-filesystem).  The operator is responsible for ensuring that all the 
  720.  machines will be up at the time the dump happens.  If a machine is not 
  721.  running, its files will not be dumped, and the next day's incremental dump 
  722.  will not store files that would have gone onto that dump. 
  723.  
  724.                       #!/bin/csh
  725.                       # Dump thingie
  726.                       set now = `date`
  727.                       set then = `cat date.nfs.dump`
  728.                       /u/hack/bin/tar -c -G -v\
  729.                        -f /dev/rtu20\
  730.                        -b 126\
  731.                        -N "$then"\
  732.                        -V "Dump from $then to $now"\
  733.                        /alpha-bits/gp\
  734.                        /gnu/hack\
  735.                        /hobbes/u\
  736.                        /spiff/u\
  737.                        /sugar-bombs/u
  738.                       echo $now > date.nfs.dump
  739.                       mt -f /dev/rtu20 rew
  740.  
  741.  Output from this script is stored in a file, for the operator to read later. 
  742.  
  743.  This script uses the file 'date.nfs.dump' to store the date/time of the last 
  744.  dump. 
  745.  
  746.  Since this is a streaming tape drive, no attempt to verify the archive is 
  747.  done.  This is also why the high blocking factor (126) is used.  The tape 
  748.  drive must also be rewound by the mt command after the dump is made. 
  749.  
  750.  
  751. ΓòÉΓòÉΓòÉ 8. Common Problems Using tar ΓòÉΓòÉΓòÉ
  752.  
  753.  Unless you use the -P option, GNU tar will not allow you to create an archive 
  754.  that contains absolute pathnames.  (An absolute pathname is one that begins 
  755.  with a '/'.) If you try, tar will automatically remove the leading '/' from 
  756.  the file names it stores in the archive.  It will also type a warning message 
  757.  telling you what it is doing. 
  758.  
  759.  When reading an archive that was created with a different tar program, GNU tar 
  760.  automatically extracts entries in the archive which have absolute pathnames as 
  761.  if the pathnames were not absolute.  If the archive contained a file 
  762.  '/usr/bin/computoy', GNU tar would extract the file to 'usr/bin/computoy' in 
  763.  the current directory.  If you want to extract the files in an archive to the 
  764.  same absolute names that they had when the archive was created, you should do 
  765.  a 'cd /' before extracting the files from the archive, or you should either 
  766.  use the '-P' option, or use the command 'tar -C / ┬╖┬╖┬╖'. 
  767.  
  768.  Some versions of UNIX, (Ultrix 3.1 is know to have this problem) can claim 
  769.  that a short write near the end of a tape succeeded, when it actually failed. 
  770.  This will result in the -M option not working correctly.  The best workaround 
  771.  at the moment is to use a significantly larger blocksize than the default 20. 
  772.  
  773.  In order to update an archive, tar must be able to backspace the archive in 
  774.  order to re-read or re-write a block that was just read (or written).  This is 
  775.  currently possible only on two kinds of files:  normal disk files (or any 
  776.  other file that can be backspaced with lseek()), and industry-standard 9-track 
  777.  magnetic tape (or any other kind of tape that can be backspaced with 
  778.  ioctl(┬╖┬╖┬╖,MTIOCTOP,┬╖┬╖┬╖)). 
  779.  
  780.  This means that the '-r', '-u', '-A', and '-D' commands will not work on any 
  781.  other kind of file.  Some media simply cannot be backspaced, which means these 
  782.  commands and options will never be able to work on them.  These 
  783.  non-backspacing media include pipes and cartridge tape drives. 
  784.  
  785.  Some other media can be backspaced, and tar will work on them once tar is 
  786.  modified to do so. 
  787.  
  788.  Archives created with the '-M', '-V', and '-G' options may not be readable by 
  789.  other version of tar.  In particular, restoring a file that was split over a 
  790.  volume boundary will require some careful work with dd, if it can be done at 
  791.  all.  Other versions of tar may also create an empty file whose name is that 
  792.  of the volume header.  Some versions of tar may create normal files instead of 
  793.  directories archived with the '-G' option. 
  794.  
  795.  
  796. ΓòÉΓòÉΓòÉ 9. The Remote Tape Server ΓòÉΓòÉΓòÉ
  797.  
  798.  In order to access the tape drive on a remote machine, tar uses the remote 
  799.  tape server written at the University of California at Berkeley.  The remote 
  800.  tape server must be installed as '/etc/rmt' on any machine whose tape drive 
  801.  you want to use. tar calls '/etc/rmt' by running an rsh or remsh to the remote 
  802.  machine, optionally using a different login name if one is supplied. 
  803.  
  804.  A copy of the source for the remote tape server is provided.  It is Copyright 
  805.  (C) 1983 by the Regents of the University of California, but can be freely 
  806.  distributed.  Instructions for compiling and installing it are included in the 
  807.  'Makefile'. 
  808.  
  809.  The remote tape server may need to be modified in order to run on a non-4.3BSD 
  810.  system. 
  811.  
  812.  
  813. ΓòÉΓòÉΓòÉ 10. The Format of a tar Archive ΓòÉΓòÉΓòÉ
  814.  
  815.  This chapter is based heavily on John Gilmore's tar(5) manual page for the 
  816.  public domain tar that GNU tar is based on. 
  817.  
  818.  
  819. ΓòÉΓòÉΓòÉ 10.1. The Standard Format ΓòÉΓòÉΓòÉ
  820.  
  821.  A tar tape or file contains a series of records.  Each record contains 
  822.  RECORDSIZE bytes.  Although this format may be thought of as being on magnetic 
  823.  tape, other media are often used. 
  824.  
  825.  Each file archived is represented by a header record which describes the file, 
  826.  followed by zero or more records which give the contents of the file.  At the 
  827.  end of the archive file there may be a record filled with binary zeros as an 
  828.  end-of-file marker.  A reasonable system should write a record of zeros at the 
  829.  end, but must not assume that such a record exists when reading an archive. 
  830.  
  831.  The records may be blocked for physical I/O operations.  Each block of N 
  832.  records (where N is set by the '-b' option to tar) is written with a single 
  833.  write() operation.  On magnetic tapes, the result of such a write is a single 
  834.  tape record.  When writing an archive, the last block of records should be 
  835.  written at the full size, with records after the zero record containing all 
  836.  zeroes.  When reading an archive, a reasonable system should properly handle 
  837.  an archive whose last block is shorter than the rest, or which contains 
  838.  garbage records after a zero record. 
  839.  
  840.  The header record is defined in C as follows: 
  841.  
  842.                       /*
  843.                        * Standard Archive Format - Standard TAR - USTAR
  844.                        */
  845.                       #define RECORDSIZE      512
  846.                       #define NAMSIZ        100
  847.                       #define TUNMLEN        32
  848.                       #define TGNMLEN        32
  849.                       #define SPARSE_EXT_HDR    21
  850.                       #define    SPARSE_IN_HDR    4
  851.                       struct sparse {
  852.                           char offset[12];
  853.                           char numbytes[12];
  854.                       };
  855.                       union record {
  856.                         char     charptr[RECORDSIZE];
  857.                         struct header {
  858.                           char   name[NAMSIZ];
  859.                           char   mode[8];
  860.                           char   uid[8];
  861.                           char   gid[8];
  862.                           char   size[12];
  863.                           char   mtime[12];
  864.                           char   chksum[8];
  865.                           char   linkflag;
  866.                           char   linkname[NAMSIZ];
  867.                           char   magic[8];
  868.                           char   uname[TUNMLEN];
  869.                           char   gname[TGNMLEN];
  870.                           char   devmajor[8];
  871.                           char   devminor[8];
  872.                           /* these following fields were added by JF for gnu */
  873.                           /* and are NOT standard */
  874.                           char    atime[12];
  875.                           char    ctime[12];
  876.                           char    offset[12];
  877.                           char    longnames[4];
  878.                           /* the next three fields were added by JK to deal with
  879.                              shrinking down sparse files */
  880.                           struct    sparse sp[SPARSE_IN_HDR];
  881.                           char    isextended;
  882.                           char    ending_blanks[12];    /* number of nulls at the
  883.                                             end of the file, if any */
  884.                         } header;
  885.                         struct extended_header {
  886.                           struct sparse sp[21];
  887.                           char isextended;
  888.                         } ext_hdr;
  889.                       };
  890.                       /* The checksum field is filled with this while the checksum is computed. */
  891.                       #define   CHKBLANKS   "     "     /* 8 blanks, no null */
  892.                       /* The magic field is filled with this if uname and gname are valid. */
  893.                       #define   TMAGIC   "ustar  "     /* 7 chars and a null */
  894.                       /* The magic field is filled with this if this is a GNU format dump entry */
  895.                       #define   GNUMAGIC  "GNUtar "     /* 7 chars and a null */
  896.                       /* The linkflag defines the type of file */
  897.                       #define  LF_OLDNORMAL '\0'    /* Normal disk file, Unix compatible */
  898.                       #define  LF_NORMAL   '0'     /* Normal disk file */
  899.                       #define  LF_LINK    '1'     /* Link to previously dumped file */
  900.                       #define  LF_SYMLINK  '2'     /* Symbolic link */
  901.                       #define  LF_CHR    '3'     /* Character special file */
  902.                       #define  LF_BLK    '4'     /* Block special file */
  903.                       #define  LF_DIR    '5'     /* Directory */
  904.                       #define  LF_FIFO    '6'     /* FIFO special file */
  905.                       #define  LF_CONTIG   '7'     /* Contiguous file */
  906.                       /* Further link types which were defined later. */
  907.                       #define LF_DUMPDIR    'D'        /* This is a dir entry that contains
  908.                                             the names of files that were in
  909.                                             the dir at the time the dump
  910.                                             was made */
  911.                       #define LF_MULTIVOL    'M'        /* This is the continuation
  912.                                             of a file that began on another
  913.                                             volume */
  914.                       #define LF_SPARSE    'S'        /* This is for sparse files */
  915.                       #define LF_VOLHDR    'V'        /* This file is a tape/volume header */
  916.                                           /* Ignore it on extraction */
  917.                       /* Bits used in the mode field - values in octal */
  918.                       #define  TSUID   04000     /* Set UID on execution */
  919.                       #define  TSGID   02000     /* Set GID on execution */
  920.                       #define  TSVTX   01000     /* Save text (sticky bit) */
  921.                       /* File permissions */
  922.                       #define  TUREAD  00400     /* read by owner */
  923.                       #define  TUWRITE  00200     /* write by owner */
  924.                       #define  TUEXEC  00100     /* execute/search by owner */
  925.                       #define  TGREAD  00040     /* read by group */
  926.                       #define  TGWRITE  00020     /* write by group */
  927.                       #define  TGEXEC  00010     /* execute/search by group */
  928.                       #define  TOREAD  00004     /* read by other */
  929.                       #define  TOWRITE  00002     /* write by other */
  930.                       #define  TOEXEC  00001     /* execute/search by other */
  931.  
  932.  All characters in header records are represented by using 8-bit characters in 
  933.  the local variant of ASCII.  Each field within the structure is contiguous; 
  934.  that is, there is no padding used within the structure.  Each character on the 
  935.  archive medium is stored contiguously. 
  936.  
  937.  Bytes representing the contents of files (after the header record of each 
  938.  file) are not translated in any way and are not constrained to represent 
  939.  characters in any character set.  The tar format does not distinguish text 
  940.  files from binary files, and no translation of file contents is performed. 
  941.  
  942.  The name, linkname, magic, uname, and gname are null-terminated character 
  943.  strings.  All other fileds are zero-filled octal numbers in ASCII.  Each 
  944.  numeric field of width w contains w minus 2 digits, a space, and a null, 
  945.  except size, and mtime, which do not contain the trailing null. 
  946.  
  947.  The name field is the pathname of the file, with directory names (if any) 
  948.  preceding the file name, separated by slashes. 
  949.  
  950.  The mode field provides nine bits specifying file permissions and three bits 
  951.  to specify the Set UID, Set GID, and Save Text (``stick'') modes.  Values for 
  952.  these bits are defined above.  When special permissions are required to create 
  953.  a file with a given mode, and the user restoring files from the archive does 
  954.  not hold such permissions, the mode bit(s) specifying those special 
  955.  permissions are ignored.  Modes which are not supported by the operating 
  956.  system restoring files from the archive will be ignored.  Unsupported modes 
  957.  should be faked up when creating or updating an archive; e.g. the group 
  958.  permission could be copied from the other permission. 
  959.  
  960.  The uid and gid fields are the numeric user and group ID of the file owners, 
  961.  respectively.  If the operating system does not support numeric user or group 
  962.  IDs, these fields should be ignored. 
  963.  
  964.  The size field is the size of the file in bytes; linked files are archived 
  965.  with this field specified as zero. See Extraction Options; in particular the 
  966.  '-G' option. 
  967.  
  968.  The mtime field is the modification time of the file at the time it was 
  969.  archived.  It is the ASCII representation of the octal value of the last time 
  970.  the file was modified, represented as an integer number of seconds since 
  971.  January 1, 1970, 00:00 Coordinated Universal Time. 
  972.  
  973.  The chksum field is the ASCII representation of the octal value of the simple 
  974.  sum of all bytes in the header record.  Each 8-bit byte in the header is added 
  975.  to an unsigned integer, initialized to zero, the precision of which shall be 
  976.  no less than seventeen bits.  When calculating the checksum, the chksum field 
  977.  is treated as if it were all blanks. 
  978.  
  979.  The typeflag field specifies the type of file archived.  If a particular 
  980.  implementation does not recognize or permit the specified type, the file will 
  981.  be extracted as if it were a regular file.  As this action occurs, tar issues 
  982.  a warning to the standard error. 
  983.  
  984.  The atime and ctime fields are used in making incremental backups; they store, 
  985.  respectively, the particular file's access time and last inode-change time. 
  986.  
  987.  The offset is used by the -M option, when making a multi-volume archive.  The 
  988.  offset is number of bytes into the file that we need to restart at to continue 
  989.  the file on the next tape, i.e., where we store the location that a continued 
  990.  file is continued at. 
  991.  
  992.  The longnames field of the header belongs with something that is not yet 
  993.  implemented in tar, and is therefore empty. 
  994.  
  995.  The following fields were added to deal with sparse files.  A file is sparse 
  996.  if it takes in unallocated blocks which end up being represented as zeros, 
  997.  i.e., no useful data.  A test to see if a file is sparse is to look at the 
  998.  number blocks allocated for it versus the number of characters in the file; if 
  999.  there are fewer blocks allocated for the file than would normally be allocated 
  1000.  for a file of that size, then the file is sparse.  This is the method tar uses 
  1001.  to detect a sparse file, and once such a file is detected, it is treated 
  1002.  differently from non-sparse files. 
  1003.  
  1004.  Sparse files are often dbm files, or other database-type files which have data 
  1005.  at some points and emptiness in the greater part of the file.  Such files can 
  1006.  appear to be very large when an ls -l is done on them, when in truth, there 
  1007.  may be a very small amount of important data contained in the file.  It is 
  1008.  thus undesirable to have tar think that it must back up this entire file, as 
  1009.  great quantities of room are wasted on empty blocks, which can lead to running 
  1010.  out of room on a tape far earlier than is necessary.  Thus, sparse files are 
  1011.  dealt with so that these empty blocks are not written to the tape.  Instead, 
  1012.  what is written to the tape is a description, of sorts, of the sparse file: 
  1013.  where the holes are, how big the holes are, and how much data is found at the 
  1014.  end of the hole.  This way, the file takes up potentially far less room on the 
  1015.  tape, and when the file is extracted later on, it will look exactly the way it 
  1016.  looked beforehand.  The following is a description of the fields used to 
  1017.  handle a sparse file: 
  1018.  
  1019.  The sp is an array of struct sparse.  Each struct sparse contains two 
  1020.  12-character strings which represent an offset into the file and a number of 
  1021.  bytes to be written at that offset.  The offset is absolute, and not relative 
  1022.  to the offset in preceding array element. 
  1023.  
  1024.  The header can hold four of these struct sparse at the moment; if more are 
  1025.  needed, they are not stored in the header. 
  1026.  
  1027.  The isextended flag is set when an extended_header is needed to deal with a 
  1028.  file.  Note that this means that this flag can only be set when dealing with a 
  1029.  sparse file, and it is only set in the event that the description of the file 
  1030.  will not fit in the alloted room for sparse structures in the header.  In 
  1031.  other words, an extended_header is needed. 
  1032.  
  1033.  The extended_header structure is used for sparse files which need more sparse 
  1034.  structures than can fit in the header.  The header can fit 4 such structures; 
  1035.  if more are needed, the flag isextended gets set and the next record is an 
  1036.  extended_header. 
  1037.  
  1038.  Each extended_header structure contains an array of 21 sparse structures, 
  1039.  along with a similar isextended flag that the header had.  There can be an 
  1040.  indeterminate number of such extended_headers to describe a sparse file. 
  1041.  
  1042.  LF_NORMAL 
  1043.  
  1044.  LF_OLDNORMALThese flags represent a regular file.  In order to be compatible 
  1045.            with older versions of tar, a typeflag value of LF_OLDNORMAL should 
  1046.            be silently recognized as a regular file.  New archives should be 
  1047.            created using LF_NORMAL.  Also, for backward compatibility, tar 
  1048.            treats a regular file whose name ends with a slash as a directory. 
  1049.  
  1050.  LF_LINK   This flag represents a file linked to another file, of any type, 
  1051.            previously archived.  Such files are identified in Unix by each file 
  1052.            having the same device and inode number.  The linked-to name is 
  1053.            specified in the linkname field with a trailing null. 
  1054.  
  1055.  LF_SYMLINKThis represents a symbolic link to another file.  The linked-to name 
  1056.            is specified in the linkname field with a trailing null. 
  1057.  
  1058.   LF_CHR
  1059.  
  1060.  LF_BLK    These represent character special files and block special files 
  1061.            respectively.  In this case the devmajor and devminor fields will 
  1062.            contain the major and minor device numbers respectively.  Operating 
  1063.            systems may map the device specifications to their own local 
  1064.            specification, or may ignore the entry. 
  1065.  
  1066.  LF_DIR    This flag specifies a directory or sub-directory.  The directory 
  1067.            name in the name field should end with a slash.  On systems where 
  1068.            disk allocation is performed on a directory basis, the size field 
  1069.            will contain the maximum number of bytes (which may be rounded to 
  1070.            the nearest disk block allocation unit) which the directory may 
  1071.            hold.  A size field of zero indicates no such limiting. Systems 
  1072.            which do not support limiting in this manner should ignore the size 
  1073.            field. 
  1074.  
  1075.  LF_FIFO   This specifies a FIFO special file.  Note that the archiving of a 
  1076.            FIFO file archives the existence of this file and not its contents. 
  1077.  
  1078.  LF_CONTIG This specifies a contiguous file, which is the same as a normal file 
  1079.            except that, in operating systems which support it, all its space is 
  1080.            allocated contiguously on the disk.  Operating systems which do not 
  1081.            allow contiguous allocation should silently treat this type as a 
  1082.            normal file. 
  1083.  
  1084.  'A' ┬╖┬╖┬╖
  1085.  
  1086.  'Z'       These are reserved for custom implementations.  Some of these are 
  1087.            used in the GNU modified format, as described below. 
  1088.  
  1089.  Other values are reserved for specification in future revisions of the P1003 
  1090.  standard, and should not be used by any tar program. 
  1091.  
  1092.  The magic field indicates that this archive was output in the P1003 archive 
  1093.  format.  If this field contains TMAGIC, the uname and gname fields will 
  1094.  contain the ASCII representation of the owner and group of the file 
  1095.  respectively.  If found, the user and group ID represented by these names will 
  1096.  be used rather than the values within the uid and gid fields. 
  1097.  
  1098.  
  1099. ΓòÉΓòÉΓòÉ 10.2. GNU Extensions to the Archive Format ΓòÉΓòÉΓòÉ
  1100.  
  1101.  The GNU format uses additional file types to describe new types of files in an 
  1102.  archive.  These are listed below. 
  1103.  
  1104.  LF_DUMPDIR 
  1105.  
  1106.  'D'       This represents a directory and a list of files created by the '-G' 
  1107.            option.  The size field gives the total size of the associated list 
  1108.            of files.  Each filename is preceded by either a 'Y' (the file 
  1109.            should be in this archive) or an 'N' (The file is a directory, or is 
  1110.            not stored in the archive).  Each filename is terminated by a null. 
  1111.            There is an additional null after the last filename. 
  1112.  
  1113.   LF_MULTIVOL
  1114.  
  1115.  'M'       This represents a file continued from another volume of a 
  1116.            multi-volume archive created with the '-M' option.  The original 
  1117.            type of the file is not given here.  The size field gives the 
  1118.            maximum size of this piece of the file (assuming the volume does not 
  1119.            end before the file is written out).  The offset field gives the 
  1120.            offset from the beginning of the file where this part of the file 
  1121.            begins.  Thus size plus offset should equal the original size of the 
  1122.            file. 
  1123.  
  1124.   LF_SPARSE
  1125.  
  1126.  'S'       This flag indicates that we are dealing with a sparse file.  Note 
  1127.            that archiving a sparse file requires special operations to find 
  1128.            holes in the file, which mark the positions of these holes, along 
  1129.            with the number of bytes of data to be found after the hole. 
  1130.  
  1131.   LF_VOLHDR
  1132.  
  1133.  'V'       This file type is used to mark the volume header that was given with 
  1134.            the '-V' option when the archive was created.  The name field 
  1135.            contains the name given after the '-V' option. The size field is 
  1136.            zero.  Only the first file in each volume of an archive should have 
  1137.            this type. 
  1138.  
  1139.  You may have trouble reading a GNU format archive on a non-GNU system if the 
  1140.  options '-G', '-M', '-S', or '-V' were used when writing the archive.  In 
  1141.  general, if tar does not use the GNU-added fields of the header, other 
  1142.  versions of tar should be able to read the archive.  Otherwise, the tar 
  1143.  program will give an error, the most likely one being a checksum error. 
  1144.  
  1145.  
  1146. ΓòÉΓòÉΓòÉ 11. Concept Index ΓòÉΓòÉΓòÉ
  1147.  
  1148.  
  1149.