home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / info / tar.info-4 < prev    next >
Encoding:
GNU Info File  |  1996-10-12  |  49.2 KB  |  1,203 lines

  1. This is Info file tar.info, produced by Makeinfo-1.64 from the input
  2. file /ade-src/fsf/tar/doc/tar.texinfo.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * tar: (tar).            Making tape (or disk) archives.
  6. END-INFO-DIR-ENTRY
  7.  
  8.    This file documents GNU `tar', a utility used to store, backup, and
  9. transport files.
  10.  
  11.    Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
  12.  
  13.    Permission is granted to make and distribute verbatim copies of this
  14. manual provided the copyright notice and this permission notice are
  15. preserved on all copies.
  16.  
  17.    Permission is granted to copy and distribute modified versions of
  18. this manual under the conditions for verbatim copying, provided that
  19. the entire resulting derived work is distributed under the terms of a
  20. permission notice identical to this one.
  21.  
  22.    Permission is granted to copy and distribute translations of this
  23. manual into another language, under the above conditions for modified
  24. versions, except that this permission notice may be stated in a
  25. translation approved by the Foundation.
  26.  
  27. 
  28. File: tar.info,  Node: Archive Reading Options,  Next: File Writing Options,  Prev: Extracting Archive Members,  Up: Extracting Archive Members
  29.  
  30. Options to Help Read Archives
  31. -----------------------------
  32.  
  33.      *(This message will disappear, once this node revised.)*
  34.  
  35. FIXME: each option wants its own node.  summary after menu
  36.  
  37.    Normally, `tar' will request data in full block increments from an
  38. archive storage device.  If the device cannot return a full block,
  39. `tar' will report an error.  However, some devices do not always return
  40. full blocks, or do not require the last block of an archive to be
  41. padded out to the next block boundary.  To keep reading until you
  42. obtain a full block, or to accept an incomplete block if it contains an
  43. end-of-archive marker, specify the `--read-full-blocks' (`-B') option
  44. in conjunction with the `--extract' (`-x') or `--list' (`-t')
  45. operations.
  46.  
  47. FIXME: xref Listing Contents
  48.    .
  49.  
  50.    The `--read-full-blocks' (`-B') option is turned on by default when
  51. `tar' reads an archive from standard input, or from a remote machine.
  52. This is because on BSD Unix systems, attempting to read a pipe returns
  53. however much happens to be in the pipe, even if it is less than was
  54. requested.  If this option were not enabled, `tar' would fail as soon
  55. as it read an incomplete block from the pipe.
  56.  
  57.    If you're not sure of the blocking factor of an archive, you can
  58. read the archive by specifying `--read-full-blocks' (`-B') and
  59. `--block-size=512-SIZE' (`-b 512-SIZE'), using a blocking factor larger
  60. than what the archive uses.  This lets you avoid having to determine
  61. the blocking factor of an archive.
  62. FIXME: xref Blocking Factor
  63.    .
  64.  
  65. `--read-full-blocks'
  66. `-B'
  67.      Use in conjunction with `--extract' (`-x') to read an archive which
  68.      contains incomplete blocks, or one which has a blocking factor less
  69.      than the one specified.
  70.  
  71.    Normally `tar' stops reading when it encounters a block of zeros
  72. between file entries (which usually indicates the end of the archive).
  73. `--ignore-zeros' (`-i') allows `tar' to completely read an archive
  74. which contains a block of zeros before the end (i.e. a damaged archive,
  75. or one which was created by `cat'-ing several archives together).
  76.  
  77.    The `--ignore-zeros' (`-i') option is turned off by default because
  78. many versions of `tar' write garbage after the end-of-archive entry,
  79. since that part of the media is never supposed to be read.  GNU `tar'
  80. does not write after the end of an archive, but seeks to maintain
  81. compatablity among archiving utilities.
  82.  
  83. `--ignore-zeros'
  84. `-i'
  85.      To ignore blocks of zeros (ie. end-of-archive entries) which may be
  86.      encountered while reading an archive.  Use in conjunction with
  87.      `--extract' (`-x') or `--list' (`-t').
  88.  
  89.    If you are using a machine with a small amount of memory, and you
  90. need to process large list of file names, you can reduce the amount of
  91. space `tar' needs to process the list.  To do so, specify the
  92. `--same-order' (`-s') option and provide an ordered list of file names.
  93. This option tells `tar' that the NAME arguments provided on the command
  94. line, or read from a file using the `--files-from=FILE-OF-NAMES' (`-T
  95. FILE-OF-NAMES') option, are listed in the same order as the files in
  96. the archive.
  97.  
  98.    You can create a file containing an ordered list of files in the
  99. archive by storing the output produced by `tar --list
  100. --file=ARCHIVE-NAME'.
  101. FIXME: xref Listing Contents
  102.    , for information on the `--list' (`-t') operation.
  103.  
  104.    This option is probably never needed on modern computer systems.
  105.  
  106. `--same-order'
  107. `--preserve-order'
  108. `-s'
  109.      To process large lists of file names on machines with small
  110.      amounts of memory.  Use in conjunction with `--compare' (`-d'),
  111.      `--list' (`-t') or `--extract' (`-x').
  112.  
  113. FIXME: we don't need/want --preserve to exist any more
  114.  
  115. 
  116. File: tar.info,  Node: File Writing Options,  Next: Scarce Disk Space,  Prev: Archive Reading Options,  Up: Extracting Archive Members
  117.  
  118. Changing How `tar' Writes Files
  119. -------------------------------
  120.  
  121. FIXME: find a better title
  122.  
  123.      *(This message will disappear, once this node revised.)*
  124.  
  125.    Normally, `tar' writes extracted files into the file system without
  126. regard to the files already on the system--files with the same name as
  127. archive members are overwritten.  To prevent `tar' from extracting an
  128. archive member from an archive, if doing so will overwrite a file in
  129. the file system, use `--keep-old-files' (`-k') in conjunction with the
  130. `--extract' (`-x') operation.  When this option is specified, `tar'
  131. reports an error stating the name of the files in conflict, instead of
  132. writing the file from the archive.
  133.  
  134. `--keep-old files'
  135. `-k'
  136.      Prevents `tar' from overwriting files in the file system during
  137.      extraction.
  138.  
  139.    Normally, `tar' sets the modification times of extracted files to
  140. the modification times recorded for the files in the archive, but
  141. limits the permissions of extracted files by the current `umask'
  142. setting.
  143.  
  144.    To set the modification times of extracted files to the time when
  145. the files were extracted, use the `--modification-time' (`-m') option in
  146. conjunction with `--extract' (`-x').
  147.  
  148. `--modification-time'
  149. `-m'
  150.      Sets the modification time of extracted archive members to the time
  151.      they were extracted, not the time recorded for them in the archive.
  152.      Use in conjunction with `--extract' (`-x').
  153.  
  154.    To set the modes (access permissions) of extracted files to those
  155. recorded for those files in the archive, use the {No Value For
  156. "same-persmissions"} option in conjunction with the `--extract' (`-x')
  157. operation.
  158. FIXME: mib --- should be aliased to ignore-umask.
  159.  
  160. `--preserve-permission'
  161. `--same-permission'
  162. `--ignore-umask'
  163. `-p'
  164.      Set modes of extracted archive members to those recorded in the
  165.      archive, instead of current umask settings.  Use in conjunction
  166.      with `--extract' (`-x').
  167.  
  168. FIXME: following paragraph needs to be rewritten: why doesnt' this cat
  169. FIXME: files together, why is this useful.  is it really useful with
  170. FIXME: more than one file?
  171.    To write the files extracted to the standard output, instead of
  172. creating the files on the file system, use `--to-stdout' (`-O') in
  173. conjunction with `--extract' (`-x').  This option is useful if you are
  174. extracting files to send them through a pipe, and do not need to
  175. preserve them in the file system.
  176.  
  177. `--to-stdout'
  178. `-O'
  179.      Writes files to the standard output.  Used in conjunction with
  180.      `--extract' (`-x').
  181.  
  182. FIXME: why would you want to do such a thing, how are files separated on
  183. FIXME: the standard output? is this useful with more that one file?  are
  184. FIXME: pipes the real reason?
  185.  
  186. 
  187. File: tar.info,  Node: Scarce Disk Space,  Prev: File Writing Options,  Up: Extracting Archive Members
  188.  
  189. Recovering From Scarce Disk Space
  190. ---------------------------------
  191.  
  192.      *(This message will disappear, once this node revised.)*
  193.  
  194.    If a previous attempt to extract files failed due to lack of disk
  195. space, you can use `--starting-file=NAME' (`-K NAME') to start
  196. extracting only after file NAME when extracting files from the archive.
  197. This assumes, of course, that there is now free space, or that you are
  198. now extracting into a different file system.
  199.  
  200. `--starting-file=FILE NAME'
  201. `-K FILE NAME'
  202.      Starts an operation in the middle of an archive.  Use in
  203.      conjunction with `--extract' (`-x') or `--list' (`-t').
  204.  
  205.    If you notice you are running out of disk space during an extraction
  206. operation, you can also suspend `tar', remove unnecessary files from
  207. the file system, and then restart the same `tar' operation.  In this
  208. case, `--starting-file=NAME' (`-K NAME') is not necessary.
  209.  
  210. FIXME: xref --incremental,  xref --interactive,  xref --exclude
  211.  
  212. 
  213. File: tar.info,  Node: Comparing Archives Members with Files,  Next: Matching Format Parameters,  Prev: Extracting Archive Members,  Up: Basic tar Operations
  214.  
  215. Comparing Archives Members with Files
  216. =====================================
  217.  
  218.      *(This message will disappear, once this node revised.)*
  219.  
  220.    The `--compare' (`-d') or `--diff' option compares the contents of
  221. the specified archive members against the files with the same names,
  222. and reports its findings.  If no members are named on the command line,
  223. or through `--files-from=FILE-OF-NAMES' (`-T FILE-OF-NAMES'), then the
  224. entire archive is so compared.
  225.  
  226. 
  227. File: tar.info,  Node: Matching Format Parameters,  Prev: Comparing Archives Members with Files,  Up: Basic tar Operations
  228.  
  229. Matching the Format Parameters
  230. ==============================
  231.  
  232.      *(This message will disappear, once this node revised.)*
  233.  
  234.    Some format parameters must be taken into consideration when
  235. modifying an archive:
  236.  
  237.    Compressed archives cannot be modified.
  238.  
  239.    You have to specify the block size of the archive when modifying an
  240. archive with a non-default block size.
  241.  
  242.    Multi-volume archives can be modified like any other archive.  To add
  243. files to a multi-volume archive, you need to only mount the last volume
  244. of the archive media (and new volumes, if needed).  For all other
  245. operations, you need to use the entire archive.
  246.  
  247.    If a multi-volume archive was labeled using `--label=ARCHIVE-LABEL'
  248. (`-V ARCHIVE-LABEL') (
  249. FIXME: pxref Archive Label
  250.    ) when it was created, `tar' will not automatically label volumes
  251. which are added later.  To label subsequent volumes, specify
  252. `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL') again in conjunction with
  253. the `--append' (`-r'), `--update' (`-u') or `--concatenate' (`-A')
  254. operation.
  255. FIXME: example
  256.  
  257. FIXME: xref somewhere, for more information about format parameters.
  258.  
  259. 
  260. File: tar.info,  Node: Specifying Names to tar,  Next: Being Careful,  Prev: Basic tar Operations,  Up: Top
  261.  
  262. Specifying Names to `tar'
  263. *************************
  264.  
  265.      *(This message will disappear, once this node revised.)*
  266.  
  267. * Menu:
  268.  
  269. * Changing the Archive Name::
  270. * Characteristics::
  271. * Selection Options::
  272.  
  273. 
  274. File: tar.info,  Node: Changing the Archive Name,  Next: Characteristics,  Prev: Specifying Names to tar,  Up: Specifying Names to tar
  275.  
  276. Changing the Archive Name
  277. =========================
  278.  
  279.      *(This message will disappear, once this node revised.)*
  280.  
  281.    By default, `tar' uses an archive file name compiled in when `tar'
  282. was built.  Usually this refers to some physical tape drive on the
  283. machine.  Often, the installer of `tar' didn't set the default to
  284. anything meaningful at all.
  285.  
  286.    As a result, most uses of `tar' need to tell `tar' where to find (or
  287. create) the archive.  The `--file=ARCHIVE-NAME' (`-f ARCHIVE-NAME')
  288. option selects another file to use as the archive.
  289.  
  290.    If the archive file name includes a colon (`:'), then it is assumed
  291. to be a file on another machine.  If the archive file is
  292. `USER@HOST:FILE', then FILE is used on the host HOST.  The remote host
  293. is accessed using the `rsh' program, with a username of USER.  If the
  294. username is omitted (along with the `@' sign), then your user name will
  295. be used.  (This is the normal `rsh' behavior.)  It is necessary for the
  296. remote machine, in addition to permitting your `rsh' access, to have
  297. the `/usr/ucb/rmt' program installed.  If you need to use a file whose
  298. name includes a colon, then the remote tape drive behavior can be
  299. inhibited by using the `--force-local' option.
  300.  
  301.    If the file name you give to `--file=ARCHIVE-NAME' (`-f
  302. ARCHIVE-NAME') is a single dash (`-'), then `tar' will read the archive
  303. from (or write it to) standard input (or standard output).
  304.  
  305.    The Name of an Archive
  306.  
  307.    An archive can be saved as a file in the file system, sent through a
  308. pipe or over a network, or written to an I/O device such as a tape or
  309. disk drive.  To specify the name of the archive, use the
  310. `--file=ARCHIVE-NAME' (`-f ARCHIVE-NAME') option.
  311.  
  312.    An archive name can be the name of an ordinary file or the name of an
  313. I/O device.  `tar' always needs an archive name--if you do not specify
  314. an archive name, the archive name comes from the environment variable
  315. `TAPE' or, if that variable is not specified, a default archive name,
  316. which is usually the name of tape unit zero (ie.  /dev/tu00).
  317.  
  318.    If you use `-' as an ARCHIVE-NAME, `tar' reads the archive from
  319. standard input (when listing or extracting files), or writes it to
  320. standard output (when creating an archive).  If you use `-' as an
  321. ARCHIVE-NAME when modifying an archive, `tar' reads the original
  322. archive from its standard input and writes the entire new archive to
  323. its standard output.
  324.  
  325. FIXME: does standard input and output redirection work with all
  326. FIXME: operations?
  327. FIXME: need example for standard input and output (screen and keyboard?)
  328.  
  329.    To specify an archive file on a device attached to a remote machine,
  330. use the following:
  331.  
  332.      --file=HOSTNAME:/DEV/FILE NAME
  333.  
  334. `tar' will complete the remote connection, if possible, and prompt you
  335. for a username and password.  If you use `--file=@HOSTNAME:/DEV/FILE
  336. NAME', `tar' will complete the remote connection, if possible, using
  337. your username as the username on the remote machine.
  338.  
  339. FIXME: is this clear?
  340.  
  341. `--file=ARCHIVE-NAME'
  342. `-f ARCHIVE-NAME'
  343.      Names the archive to create or operate on.  Use in conjunction with
  344.      any operation.
  345.  
  346.    Selecting Archive Members
  347.  
  348.    "File Name arguments" specify which files in the file system `tar'
  349. operates on, when creating or adding to an archive, or which archive
  350. members `tar' operates on, when reading or deleting from an archive.  (
  351. FIXME: pxref Reading and Writing
  352.    .)
  353.  
  354.    To specify file names, you can include them as the last arguments on
  355. the command line, as follows:
  356.      tar OPERATION [OPTION1 OPTION2 ..] [FILE NAME-1 FILE NAME-2 ...]
  357.  
  358.    If you specify a directory name as a file name argument, all the
  359. files in that directory are operated on by `tar'.
  360.  
  361.    If you do not specify files when `tar' is invoked, `tar' operates on
  362. all the non-directory files in the working directory (if the operation
  363. is `--create' (`-c')), all the archive members in the archive (if a
  364. read operation is specified), or does nothing (if any other operation
  365. is specified).
  366.  
  367.    When specifying the names of files or members to `tar', it by
  368. default takes the names of the files from the command line.  There are
  369. other ways, however, to specify file or member names, or to modify the
  370. manner in which `tar' selects the files or members upon which to
  371. operate.  In general, these methods work both for specifying the names
  372. of files and archive members.
  373.  
  374. 
  375. File: tar.info,  Node: Characteristics,  Next: Selection Options,  Prev: Changing the Archive Name,  Up: Specifying Names to tar
  376.  
  377. Selecting Files by Characteristic
  378. =================================
  379.  
  380.    To avoid crossing file system boundaries when archiving parts of a
  381. directory tree, use `--one-file-system' (`-l').  This option only
  382. affects files that are archived because they are in a directory that is
  383. being archived; files explicitly named on the command line are archived
  384. regardless of where they reside.
  385.  
  386.    This option is useful for making full or incremental archival backups
  387. of a file system.
  388.  
  389.    If this option is used in conjunction with `--verbose' (`-v'), files
  390. that are excluded are mentioned by name on the standard error.
  391.  
  392. `--one-file-system'
  393. `-l'
  394.      Prevents `tar' from crossing file system boundaries when
  395.      archiving.  Use in conjunction with any write operation.
  396.  
  397.    To avoid operating on files whose names match a particular pattern,
  398. use the `--exclude=PATTERN' or `--exclude-from=FILE-OF-PATTERNS' (`-X
  399. FILE-OF-PATTERNS') options.
  400.  
  401.    When you specify the `--exclude=PATTERN' option, `tar' ignores files
  402. which match the PATTERN, which can be a single file name or a more
  403. complex expression.  Thus, if you invoke `tar' with `tar --create
  404. --exclude=*.o', no files whose names end in `.o' are included in the
  405. archive.
  406. FIXME: what other things can you use besides "*"?
  407.  
  408.    `--exclude-from=FILE-OF-PATTERNS' (`-X FILE-OF-PATTERNS') acts like
  409. `--exclude=PATTERN', but specifies a file FILE containing a list of
  410. patterns.  `tar' ignores files with names that fit any of these
  411. patterns.
  412.  
  413.    You can use either option more than once in a single command.
  414.  
  415. `--exclude=PATTERN'
  416.      Causes `tar' to ignore files that match the PATTERN.
  417.  
  418. `--exclude-from=FILE'
  419.      Causes `tar' to ignore files that match the patterns listed in
  420.      FILE.
  421. FIXME: --exclude-from used to be "--exclude", --exclude didn't used to
  422. FIXME: exist.
  423.  
  424.    To operate only on files with modification or status-change times
  425. after a particular date, use `--after-date=DATE' (`-N DATE').  You can
  426. use this option with `--create' (`-c') or `--append' (`-r') to insure
  427. only new files are archived, or with `--extract' (`-x') to insure only
  428. recent files are resurrected.
  429. FIXME: or --newer DATE
  430.  
  431.    `--newer-mtime=DATE' acts like `--after-date=DATE' (`-N DATE') but
  432. tests just the modification times of the files, ignoring status-change
  433. times.
  434.  
  435. FIXME: need example of --newer-mtime with quoted argument
  436.    Remember that the entire date argument should be quoted if it
  437. contains any spaces.
  438.  
  439.    *Please Note:* `--after-date=DATE' (`-N DATE') and
  440. `--newer-mtime=DATE' should not be used for incremental backups.  Some
  441. files (such as those in renamed directories) are not selected up
  442. properly by these options.
  443. FIXME: xref to incremental backup chapter when node name is decided.
  444.  
  445. `--after-date=DATE'
  446. `--newer=DATE'
  447. `-N DATE'
  448.      Acts on files only if their modification or inode-changed times are
  449.      later than DATE.  Use in conjunction with any operation.
  450.  
  451. `--newer-mtime=DATE'
  452.      Acts like `--after-date=DATE' (`-N DATE'), but only looks at
  453.      modification times.
  454.  
  455. FIXME: following is the getdate date format --- needs to be re-written,
  456. FIXME: made a sub-node:
  457.  
  458.    Time/Date Formats Accepted by getdate (omitting obscure
  459. constructions)
  460.  
  461.    The input consists of one or more of: time zone day date year in any
  462. order.
  463.  
  464.    Those in turn consist of (`|' and `/' mean `or', `[]' means
  465. `optional'):
  466.  
  467.    time: H am/pm | H:M [am/pm] | H:M:S [am/pm] zone: timezone-name |
  468. timezone-name dst day: day-name | day-name, | N day-name date: M/D |
  469. M/D/Y | month-name D | month-name D, Y | D month-name | D month-name Y
  470. year: Y
  471.  
  472.    am can also be a.m., pm can also be p.m.  case and spaces around
  473. punctuation are not significant.
  474. FIXME: month and day names can be abbreviated.
  475.  
  476. * Menu:
  477.  
  478. * Reading Names from a File::
  479. * Excluding Some Files::
  480. * Operating Only on New Files::
  481. * Crossing Filesystem Boundaries::
  482.  
  483. 
  484. File: tar.info,  Node: Reading Names from a File,  Next: Excluding Some Files,  Prev: Characteristics,  Up: Characteristics
  485.  
  486. Reading Names from a File
  487. -------------------------
  488.  
  489.      *(This message will disappear, once this node revised.)*
  490.  
  491.    Instead of giving the names of files or archive members on the
  492. command line, you can put the names into a file, and then use the
  493. `--files-from=FILE-OF-NAMES' (`-T FILE-OF-NAMES') option to `tar'.
  494. Give the name of the file which contains the list as the argument to
  495. `--files-from=FILE-OF-NAMES' (`-T FILE-OF-NAMES').  The file names
  496. should be separated by newlines in the list.  If you give a single dash
  497. as a file name for `--files-from=FILE-OF-NAMES' (`-T FILE-OF-NAMES'),
  498. that is, you specify `--files-from=-' (`-T -'), then the file names are
  499. read from standard input.
  500.  
  501.    If you want to specify names that might contain newlines, use the
  502. `--null' option.  Then, the file names should be separated by NUL
  503. characters (ASCII 000) instead of newlines.  In addition, the `--null'
  504. option turns off the `--directory=DIRECTORY' (`-C DIRECTORY') option (
  505. FIXME: pxref Changing Directory
  506.    ).
  507.  
  508.    Reading a List of File Names from a File
  509.  
  510.      *(This message will disappear, once this node revised.)*
  511.  
  512.    To read file names from a file on the file system, instead of from
  513. the command line, use the `--files-from=FILE-OF-NAMES' (`-T
  514. FILE-OF-NAMES') option.  If you specify `-' as FILE, the file names are
  515. read from standard input.  Note that using both `--files-from=-' (`-T
  516. -') and `--file=-' (`-f -') in the same command will not work unless
  517. the operation is `--create' (`-c').
  518. FIXME: xref Archive Name
  519.    , for an explanation of the `--file=ARCHIVE-NAME' (`-f
  520. ARCHIVE-NAME') option.
  521.  
  522. `--files-from=FILE'
  523. `-T FILE'
  524.      Reads file name arguments from a file on the file system, instead
  525.      of from the command line.  Use in conjunction with any operation.
  526.  
  527. 
  528. File: tar.info,  Node: Excluding Some Files,  Next: Operating Only on New Files,  Prev: Reading Names from a File,  Up: Characteristics
  529.  
  530. Excluding Some Files
  531. --------------------
  532.  
  533.      *(This message will disappear, once this node revised.)*
  534.  
  535.    The `--exclude=PATTERN' option will prevent any file or member which
  536. matches the regular expression PATTERN from being operated on.  For
  537. example, if you want to create an archive with all the contents of
  538. `/tmp' except the file `/tmp/foo', you can use the command `tar
  539. --create --file=arch.tar --exclude=foo'.
  540.  
  541.    If there are many files you want to exclude, you can use the
  542. `--exclude-from=FILE-OF-PATTERNS' (`-X FILE-OF-PATTERNS') option.  This
  543. works just like the `--files-from=FILE-OF-NAMES' (`-T FILE-OF-NAMES')
  544. option: specify the name of a file as EXCLUDE-LIST which contains the
  545. list of patterns you want to exclude.
  546.  
  547. FIXME: xref Regular Expressions
  548.    for more information on the syntax and meaning of regular
  549. expressions.
  550.  
  551. 
  552. File: tar.info,  Node: Operating Only on New Files,  Next: Crossing Filesystem Boundaries,  Prev: Excluding Some Files,  Up: Characteristics
  553.  
  554. Operating Only on New Files
  555. ---------------------------
  556.  
  557.      *(This message will disappear, once this node revised.)*
  558.  
  559.    The `--after-date=DATE' (`-N DATE') or `--newer=DATE' limits `tar'
  560. to only operating on files which have been modified after the date
  561. specified.  (For more information on how to specify a date,
  562.  
  563. FIXME: xref Date Formats
  564.    .)  A file is considered to have changed if the contents have been
  565. modified, or if the owner, permissions, and so forth, have been changed.
  566.  
  567.    If you only want `tar' make the date comparison on the basis of the
  568. actual contents of the file's modification, then use the
  569. `--newer-mtime=DATE' option.
  570.  
  571.    You should never use this option for making incremental dumps.  To
  572. learn how to use `tar' to make backups,
  573. FIXME: ref Making Backups
  574.    .
  575.  
  576. 
  577. File: tar.info,  Node: Crossing Filesystem Boundaries,  Prev: Operating Only on New Files,  Up: Characteristics
  578.  
  579. Crossing Filesystem Boundaries
  580. ------------------------------
  581.  
  582.      *(This message will disappear, once this node revised.)*
  583.  
  584.    The `--one-file-system' (`-l') option causes `tar' to modify its
  585. normal behavior in archiving the contents of directories.  If a file in
  586. a directory is not on the same filesystem as the directory itself
  587. (because it is a mounted filesystem in its own right), then `tar' will
  588. not archive that file, or (if it is a directory itself) anything
  589. beneath it.
  590.  
  591.    This does not necessarily limit `tar' to only archiving the contents
  592. of a single filesystem, because all files named on the command line, or
  593. through the `--files-from=FILE-OF-NAMES' (`-T FILE-OF-NAMES') option,
  594. will always be archived.
  595.  
  596. 
  597. File: tar.info,  Node: Selection Options,  Prev: Characteristics,  Up: Specifying Names to tar
  598.  
  599. Local file selection
  600. ====================
  601.  
  602.      *(This message will disappear, once this node revised.)*
  603.  
  604.    Local file selection
  605.  
  606. `-C DIR'
  607. `--directory DIR'
  608.      Change to directory DIR.
  609.  
  610.      This option causes `tar' to change into the directory DIR before
  611.      continuing.  This option can be interspersed with the files `tar'
  612.      is to work on.  For example,
  613.  
  614.           tar -c iggy ziggy -C baz melvin
  615.  
  616.      will place the files `iggy' and `ziggy' from the current directory
  617.      on the tape, followed by the file `melvin' from the directory
  618.      `baz'.  This option is especially useful when you have several
  619.      widely separated files that you want to store in the same
  620.      directory in the archive.
  621.  
  622.      Here, the file `melvin' is recorded in the archive under the
  623.      precise name `melvin', *not* `baz/melvin'.  Thus, the archive will
  624.      contain three files that all appear to have come from the same
  625.      directory; if the archive is extracted with plain `tar -x', all
  626.      three files will be created in the current directory.
  627.  
  628.      Contrast this with the command:
  629.  
  630.           tar -c iggy ziggy bar/melvin
  631.  
  632.      which records the third file in the archive under the name
  633.      `bar/melvin' so that, if plain `tar -x' is used, the third file
  634.      will be created in a subdirectory named `bar'.
  635.  
  636.      Suppose that, without changing your current directory, you want to
  637.      call `tar' to dump files from `/users/ctd/dipp' say.  Then
  638.      `--directory=DIRECTORY' (`-C DIRECTORY') is for you.  You could do
  639.      things like:
  640.  
  641.           tar cfC archive.tar /users/ctd/dipp .
  642.  
  643.      (the `.' means the current directory, once the
  644.      `--directory=DIRECTORY' (`-C DIRECTORY') obeyed).
  645.  
  646.      Some people might want some option to extract everything from an
  647.      archive in the current directory, ignore directory structure in
  648.      the archive.  This is so rarely proper that I doubt such an option
  649.      would be really useful.  It would only help getting around improper
  650.      `tar' usage, it might even encourage improper usage.  In general,
  651.      `--directory=DIRECTORY' (`-C DIRECTORY') might be used to produce
  652.      archives with a cleaner structure in the first place.
  653.  
  654. `-T FILENAME'
  655. `--files-from=FILENAME'
  656.      Get names to extract or create from file FILENAME.
  657.  
  658.      Instead of taking the list of files to work on from the command
  659.      line, the list of files to work on is read from the file FILENAME.
  660.      If FILENAME is given as `-', the list is read from standard input.
  661.      Note that using both `-T -' and `-f -' will not work unless you
  662.      are using the `--create' (`-c') command.
  663.  
  664.      This is typically useful when you have generated the list of files
  665.      to archive with `find'.
  666.  
  667. `--null'
  668.      This option causes `--files-from=FILE-OF-NAMES' (`-T
  669.      FILE-OF-NAMES') to read file names terminated by a NUL instead of
  670.      a newline, so files whose names contain newlines can be archived
  671.      using `--files-from=FILE-OF-NAMES' (`-T FILE-OF-NAMES').  The
  672.      `--null' option is just like the one in GNU `xargs' and `cpio',
  673.      and is useful with the `-print0' predicate of GNU `find'.  In
  674.      `tar', `--null' also causes `--directory=DIRECTORY' (`-C
  675.      DIRECTORY') options to be treated as file names to archive, in
  676.      case there are any files out there called `-C'.
  677.  
  678. `--exclude=FILE'
  679.      Exclude file FILE.
  680.  
  681. `-X FILE'
  682. `--exclude-from=FILE'
  683.      Exclude files listed in FILE.
  684.  
  685.      This option causes `tar' to read a list of regular expressions (in
  686.      shell wildcard syntax), one per line, from FILE; `tar' will ignore
  687.      files matching those regular expressions.  Thus if `tar' is called
  688.      as `tar -c -X foo .' and the file `foo' contains a single line
  689.      `*.o', no files whose names end in `.o' will be added to the
  690.      archive.  Multiple `--exclude=PATTERN' options may be given.
  691.  
  692. `-P'
  693. `--absolute-names'
  694.      Do not strip leading `/'s from file names.
  695.  
  696.      By default, GNU `tar' drops a leading `/' on input or output.
  697.      This option turns off this behavior; it's equivalent to changing
  698.      to the root directory before running `tar' (except it also turns
  699.      off the usual warning message).
  700.  
  701. `-l'
  702. `--one-file-system'
  703.      Stay in local filesystem when creating archive.
  704.  
  705.      This option causes `tar' to not cross filesystem boundaries when
  706.      archiving parts of a directory tree.  This option only affects
  707.      files that are archived because they are in a directory that is
  708.      archived; files named on the command line are archived regardless,
  709.      and they can be from various file systems.
  710.  
  711.      This option is useful for making full or incremental archival
  712.      backups of a filesystem, as with the Unix `dump' command.
  713.  
  714.      Files skipped due to this option are mentioned on standard error.
  715.  
  716. `-K NAME'
  717. `--starting-file=NAME'
  718.      Begin at file NAME in the archive.
  719.  
  720.      The `--starting-file=NAME' (`-K NAME') option causes `tar' to begin
  721.      extracting or listing the archive with the file FILENAME, and to
  722.      consider only the files starting at that point in the archive.
  723.      This is useful if a previous attempt to extract files failed when
  724.      it reached FILENAME due to lack of free space.  (Assuming, of
  725.      course, that there is now free space, or that you are now
  726.      extracting into a different file system.)
  727.  
  728. `-N DATE'
  729. `--newer=DATE'
  730. `--after-date=DATE'
  731.      Only store files newer than DATE.
  732.  
  733.      This option causes `tar' to only work on files whose modification
  734.      or inode-changed times are newer than the DATE given.  The main
  735.      use is for creating an archive; then only new files are written.
  736.      If extracting, only newer files are extracted.
  737.  
  738.      Remember that the entire date argument must be quoted if it
  739.      contains any spaces.
  740.  
  741.      The date is parsed using `getdate'.
  742.  
  743.    Changing the Names of Members when Archiving
  744.  
  745. * Menu:
  746.  
  747. * Changing Directory::
  748. * Absolute File Names::
  749.  
  750. 
  751. File: tar.info,  Node: Changing Directory,  Next: Absolute File Names,  Prev: Selection Options,  Up: Selection Options
  752.  
  753. Changing Directory
  754. ------------------
  755.  
  756.      *(This message will disappear, once this node revised.)*
  757.  
  758.    The `--directory=DIRECTORY' (`-C DIRECTORY') option causes `tar' to
  759. change its current working directory to DIRECTORY.  Unlike most
  760. options, this one is processed at the point it occurs within the list
  761. of files to be processed.  Consider the following command:
  762.      tar --create --file=foo.tar -C /etc passwd hosts -C /lib libc.a
  763.  
  764.    This command will place the files `/etc/passwd', `/etc/hosts', and
  765. `/lib/libc.a' into the archive.  However, the names of the archive
  766. members will be exactly what they were on the command line: `passwd',
  767. `hosts', and `libc.a'.  The `--directory=DIRECTORY' (`-C DIRECTORY')
  768. option is frequently used to make the archive independent of the
  769. original name of the directory holding the files.
  770.  
  771.    Note that `--directory=DIRECTORY' (`-C DIRECTORY') options are
  772. interpreted consecutively.  If `--directory=DIRECTORY' (`-C DIRECTORY')
  773. option specifies a relative file name, it is interpreted relative to
  774. the then current directory, which might not be the same as the original
  775. current working directory of `tar', due to a previous
  776. `--directory=DIRECTORY' (`-C DIRECTORY') option.
  777.  
  778.    When using `--files-from=FILE-OF-NAMES' (`-T FILE-OF-NAMES') (
  779. FIXME: pxref Reading Names from a File
  780.    ), you can put `-C' options in the file list.  Unfortunately, you
  781. cannot put `--directory' options in the file list.  (This interpretation
  782. can be disabled by using the `--null' option.)
  783.  
  784.    Changing the Working Directory Within a List of File Names
  785.  
  786.      *(This message will disappear, once this node revised.)*
  787.  
  788.    To change working directory in the middle of a list of file names,
  789. either on the command line or in a file specified using
  790. `--files-from=FILE-OF-NAMES' (`-T FILE-OF-NAMES'), use
  791. `--directory=DIRECTORY' (`-C DIRECTORY').  This will change the working
  792. directory to the directory DIRECTORY after that point in the list.  For
  793. example,
  794.  
  795.      tar --create iggy ziggy --directory=baz melvin
  796.  
  797. will place the files `iggy' and `ziggy' from the current directory into
  798. the archive, followed by the file `melvin' from the directory `baz'.
  799. This option is especially useful when you have several widely separated
  800. files that you want to store in the same directory in the archive.
  801.  
  802.    Note that the file `melvin' is recorded in the archive under the
  803. precise name `melvin', *not* `baz/melvin'.  Thus, the archive will
  804. contain three files that all appear to have come from the same
  805. directory; if the archive is extracted with plain `tar --extract', all
  806. three files will be written in the current directory.
  807.  
  808.    Contrast this with the command
  809.  
  810.      tar -c iggy ziggy bar/melvin
  811.  
  812. which records the third file in the archive under the name `bar/melvin'
  813. so that, if the archive is extracted using `tar --extract', the third
  814. file will be written in a subdirectory named `bar'.
  815.  
  816. `--directory=`directory''
  817. `-C `directory''
  818.      Changes the working directory.
  819.  
  820. FIXME: need to test how extract deals with this, and add an example
  821.  
  822. 
  823. File: tar.info,  Node: Absolute File Names,  Prev: Changing Directory,  Up: Selection Options
  824.  
  825. Absolute File Names
  826. -------------------
  827.  
  828.      *(This message will disappear, once this node revised.)*
  829.  
  830.    When `tar' extracts archive members from an archive, it strips any
  831. leading slashes (`/') from the member name.  This causes absolute
  832. member names in the archive to be treated as relative file names.  This
  833. allows you to have such members extracted wherever you want, instead of
  834. being restricted to extracting the member in the exact directory named
  835. in the archive.  For example, if the archive member has the name
  836. `/etc/passwd', `tar' will extract it as if the name were really
  837. `etc/passwd'.
  838.  
  839.    Other `tar' programs do not do this.  As a result, if you create an
  840. archive whose member names start with a slash, they will be difficult
  841. for other people with an inferior `tar' program to use.  Therefore, GNU
  842. `tar' also strips leading slashes from member names when putting
  843. members into the archive.  For example, if you ask `tar' to add the
  844. file `/bin/ls' to an archive, it will do so, but the member name will
  845. be `bin/ls'.
  846.  
  847.    If you use the `--absolute-names' (`-P') option, `tar' will do
  848. neither of these transformations.
  849.  
  850. FIXME: is this what this does, or does it just preserve the slash?
  851.  
  852.    To archive or extract files relative to the root directory, specify
  853. the `--absolute-names' (`-P') option.
  854.  
  855.    Normally, `tar' acts on files relative to the working
  856. directory--ignoring superior directory names when archiving, and
  857. ignoring leading slashes when extracting.
  858.  
  859.    When you specify `--absolute-names' (`-P'), `tar' stores file names
  860. including all superior directory names, and preserves leading slashes.
  861. If you only invoked `tar' from the root directory you would never need
  862. the `--absolute-names' (`-P') option, but using this option may be more
  863. convenient than switching to root.
  864.  
  865. FIXME: should be an example in the tutorial/wizardry section using this
  866. FIXME: to transfer files between systems.
  867.  
  868. FIXME: is write access an issue?
  869.  
  870. `--absolute-names'
  871.      Preserves full file names (inclusing superior dirctory names) when
  872.      archiving files.  Preserves leading slash when extracting files.
  873.  
  874. 
  875. File: tar.info,  Node: Being Careful,  Next: Format Control,  Prev: Specifying Names to tar,  Up: Top
  876.  
  877. Being Even More Careful
  878. ***********************
  879.  
  880. * Menu:
  881.  
  882. * Documentation::
  883. * Checking Progress::
  884. * Interactive Operation::
  885. * Write Verification::
  886. * Comparing::
  887. * Portability::
  888. * Write Protection::
  889.  
  890. 
  891. File: tar.info,  Node: Documentation,  Next: Checking Progress,  Prev: Being Careful,  Up: Being Careful
  892.  
  893. GNU `tar' documentation
  894. =======================
  895.  
  896.    Being careful, the first thing is really checking that you are using
  897. GNU `tar', indeed.  The `--version' option will generate a message
  898. giving confirmation that you are using GNU `tar', with the precise
  899. version of GNU `tar' you are using.  `tar' identifies itself and prints
  900. the version number to the standard output, then immediately exits
  901. successfully, without doing anything else, ignoring all other options.
  902. For example, `tar --version' might return:
  903.  
  904.      GNU tar version 1.11.8
  905.  
  906.    Another thing you might want to do is checking the spelling or
  907. meaning of some particular `tar' option, without resorting to this
  908. manual, for once you have carefully read it.  GNU `tar' has a short help
  909. feature, triggerable through the `--help' option.  By using this
  910. option, `tar' will print a usage message listing all available options
  911. on standard output, then exit successfully, without doing anything else
  912. and ignoring all other options.  Even if this is only a brief summary,
  913. it may be several screens long.  So, if you are not using some kind of
  914. scrollable window, you might prefer to use something like:
  915.  
  916.      tar --help | less
  917.  
  918. presuming, here, that you like using `less' for a pager.  Other popular
  919. pagers are `more' and `pg'.
  920.  
  921.    The perceptive reader would have noticed some contradiction in the
  922. previous paragraphs.  It is written that both `--version' and `--help'
  923. print something, and have all other options ignored.  In fact, they
  924. cannot ignore each other, and one of them has to win.  We do not
  925. specify which is stronger, here; experiment if you really wonder!
  926.  
  927.    The short help output is quite succint, and you might have to get
  928. back to the full documentation for precise points.  If you are reading
  929. this paragraph, you already have the `tar' manual in some form.  This
  930. manual is available in printed form, as a kind of small book.  It may
  931. printed out of the GNU `tar' distribution, provided you have TeX
  932. already installed somewhere, and a laser printer around.  Just configure
  933. the distribution, execute the command `make dvi', then print
  934. `doc/tar.dvi' the usual way (contact your local guru to know how).  If
  935. GNU `tar' has been conveniently installed at your place, this manual is
  936. also available in interactive, hypertextual form as an Info file.  Just
  937. call `info tar' or, if you do not have the `info' program handy, use
  938. the Info reader provided within GNU Emacs, calling `tar' from the main
  939. Info menu.
  940.  
  941. 
  942. File: tar.info,  Node: Checking Progress,  Next: Interactive Operation,  Prev: Documentation,  Up: Being Careful
  943.  
  944. Checking `tar' progress
  945. =======================
  946.  
  947.    Typically, `tar' performs most operations without reporting any
  948. information to the user except error messages.  When using `tar' with
  949. many options, particularly ones with complicated or
  950. difficult-to-predict behavior, it is possible to make serious mistakes.
  951. `tar' provides several options that make observing `tar' easier.  These
  952. options cause `tar' to print information as it progresses in its job,
  953. and you might want to use them just for being more careful about what
  954. is going on, or merely for entertaining yourself.  If you have
  955. encountered a problem when operating on an archive, however, you may
  956. need more information than just an error message in order to solve the
  957. problem.  The following options can be helpful diagnostic tools.
  958.  
  959.    Normally, the `--list' (`-t') command to list an archive prints just
  960. the file names (one per line) and the other commands are silent.  When
  961. used with most operations, the `--verbose' (`-v') option causes `tar'
  962. to print the name of each file or archive member as it is processed.
  963. This and the other options which make `tar' print status information
  964. can be useful in monitoring `tar'.
  965.  
  966.    With `--create' (`-c') or `--extract' (`-x'), `--verbose' (`-v')
  967. used once just prints the names of the files or members as they are
  968. processed.  Using it twice causes `tar' to print a longer listing
  969. (reminiscent of `ls -l') for each member.  Since `--list' (`-t')
  970. already prints the names of the members, `--verbose' (`-v') used once
  971. with `--list' (`-t') causes `tar' to print an `ls -l' type listing of
  972. the files in the archive.  The following examples both extract members
  973. with long list output:
  974.  
  975.      tar --extract --file=archive.tar --verbose --verbose
  976.      tar xvv archive.tar
  977.  
  978.    Verbose output appears on the standard output except when an archive
  979. is being written to the standard output, as with `tar --create --file=-
  980. --verbose' (`tar cfv -', or even `tar cv'--if the installer let
  981. standard output be the default archive).  In that case `tar' writes
  982. verbose output to the standard error stream.
  983.  
  984.    The `--totals' option--which is only meaningful when used with
  985. `--create' (`-c')--causes `tar' to print the total amount written to
  986. the archive, after it has been fully created.
  987.  
  988.    The `--checkpoint' option prints an occasional message as `tar'
  989. reads or writes the archive.  In fact, it print directory names while
  990. reading the archive.  It is designed for those who don't need the more
  991. detailed (and voluminous) output of `--record-number' (`-R'), but do
  992. want visual confirmation that `tar' is actually making forward progress.
  993. FIXME: There is some confusion here.  It seems that -R once wrote a
  994. FIXME: message at `every' block read or written.
  995.  
  996.    The `--show-omitted-dirs' option, when reading an archive--with
  997. `--list' (`-t') or `--extract' (`-x'), for example--causes a message to
  998. be printed for each directory in the archive which is skipped.  This
  999. happens regardless of the reason for skipping: the directory might not
  1000. have been named on the command line (implicitly or explicitly), it
  1001. might be excluded by the use of the `--exclude=PATTERN' option, or some
  1002. other reason.
  1003.  
  1004.    If `--record-number' (`-R') is used, `tar' prints, along with every
  1005. message it would normally produce, the record number within the archive
  1006. where the message was triggered.  This option is especially useful when
  1007. reading damaged archives, since it helps pinpoint the damaged sections.
  1008. It can also be used with `--list' (`-t') when listing a file-system
  1009. backup tape, allowing you to choose among several backup tapes when
  1010. retrieving a file later, in favor of the tape where the file appears
  1011. earliest (closest to the front of the tape).
  1012. FIXME: xref when the node name is set and the backup section written
  1013.  
  1014. 
  1015. File: tar.info,  Node: Interactive Operation,  Next: Write Verification,  Prev: Checking Progress,  Up: Being Careful
  1016.  
  1017. Asking for Confirmation During Operations
  1018. =========================================
  1019.  
  1020.    Typically, `tar' carries out a command without stopping for further
  1021. instructions.  In some situations however, you may want to exclude some
  1022. files and archive members from the operation (for instance if disk or
  1023. storage space is tight).  You can do this by excluding certain files
  1024. automatically (
  1025. FIXME: pxref File Exclusion
  1026.    ), or by performing an operation interactively, using the
  1027. `--interactive' (`-w') option.  `tar' also accepts `--confirmation' for
  1028. this option.
  1029.  
  1030.    When the `--interactive' (`-w') option is specified, before reading,
  1031. writing, or deleting files, `tar' first prints a message for each such
  1032. file, telling what operation it intends to take, then asks for
  1033. confirmation on the terminal.  The actions which require confirmation
  1034. include adding a file to the archive, extracting a file from the
  1035. archive, deleting a file from the archive, and deleting a file from
  1036. disk.  To confirm the action, you must type a line of input beginning
  1037. with `y'.  If your input line begins with anything other than `y',
  1038. `tar' skips that file.
  1039.  
  1040.    If `tar' is reading the archive from the standard input, `tar' opens
  1041. the file `/dev/tty' to support the interactive communications.
  1042.  
  1043. 
  1044. File: tar.info,  Node: Write Verification,  Next: Comparing,  Prev: Interactive Operation,  Up: Being Careful
  1045.  
  1046. Verifying Data as It is Stored
  1047. ==============================
  1048.  
  1049.    You can insure the accuracy of an archive by comparing files in the
  1050. system with archive members.  `tar' can compare an archive to the file
  1051. system as the archive is being written, to verify a write operation, or
  1052. can compare a previously written archive, to insure that it is up to
  1053. date.
  1054.  
  1055.    To check for discrepancies in an archive immediately after it is
  1056. written, use the `--verify' (`-W') option in conjunction with the
  1057. `--create' (`-c') operation.  When this option is specified, `tar'
  1058. checks archive members against their counterparts in the file system,
  1059. and reports discrepancies on the standard error.  In multi-volume
  1060. archives, each volume is verified after it is written, before the next
  1061. volume is written.
  1062.  
  1063.    To verify an archive, you must be able to read it from before the end
  1064. of the last written entry.  This option is useful for detecting data
  1065. errors on some tapes.  Archives written to pipes, some cartridge tape
  1066. drives, and some other devices cannot be verified.
  1067.  
  1068. 
  1069. File: tar.info,  Node: Comparing,  Next: Portability,  Prev: Write Verification,  Up: Being Careful
  1070.  
  1071. Comparing an Archive with the File System
  1072. =========================================
  1073.  
  1074.      *(This message will disappear, once this node revised.)*
  1075.  
  1076.    `--compare' (`-d') compares archive members in an existing archive
  1077. with their counterparts in the file system, and reports differences in
  1078. file size, mode, owner, modification date and contents.  If a file is
  1079. represented in the archive but does not exist in the file system, `tar'
  1080. reports a difference.
  1081.  
  1082.    If you use FILE NAME arguments in conjunction with `tar --compare',
  1083. `tar' compares the archived versions of the files specified with their
  1084. counterparts in the file system.  If you specify a file that is not in
  1085. the archive, `tar' will report an error.  If you don't specify any
  1086. files, `tar' compares all the files in the archive.
  1087.  
  1088.    Because `tar' only checks files in the archive against files in the
  1089. file system, and not vice versa, it ignores files in the file system
  1090. that do not exist in the archive.
  1091.  
  1092.    The following example compares the archive members `larry', `moe'
  1093. and `curly' in the archive `stooges' with files of the same name in the
  1094. file system.
  1095.  
  1096.      tar --compare --file=stooges larry moe curly
  1097.  
  1098. If a file, for example `curly', did not exist in the archive, `tar'
  1099. would report an error, as follows:
  1100.  
  1101.      curly: does not exist
  1102.  
  1103. 
  1104. File: tar.info,  Node: Portability,  Next: Write Protection,  Prev: Comparing,  Up: Being Careful
  1105.  
  1106. Making `tar' Archives More Portable
  1107. ===================================
  1108.  
  1109.    Creating a `tar' archive on a particular system, meant to be later
  1110. useful on many other machines and with other versions of `tar', is more
  1111. a challenge than you might think.  `tar' archive formats evolved since
  1112. the first versions of Unix, many such formats are flying around, not
  1113. always comptabile between them.  This section wants to discuss a few
  1114. problems, and give some advice, for making `tar' archives more portable.
  1115.  
  1116.    One golden rule is simplicity.  For example, limit your `tar'
  1117. archives to contain only regular files and directories, avoiding other
  1118. kind of special files.  Do not attempt to save sparse files or
  1119. contiguous files as such.  Let's discuss a few more problems, in turn.
  1120.  
  1121. * Menu:
  1122.  
  1123. * Portable Names::
  1124. * Symbolic Links::
  1125. * Old V7 and POSIX::
  1126. * Checksumming Problems::
  1127.  
  1128. 
  1129. File: tar.info,  Node: Portable Names,  Next: Symbolic Links,  Prev: Portability,  Up: Portability
  1130.  
  1131. Portable Names
  1132. --------------
  1133.  
  1134.    Use *straight* file and directory names, made up of printable ASCII
  1135. characters, avoiding colons, slashes, backslashes, and other
  1136. *dangerous* characters.  Avoid deep directory nesting.  Accounting for
  1137. oldish System V machines, limit your file and directory names to 14
  1138. characters or less.
  1139.  
  1140.    If you intend to have your `tar' archives to be read under MSDOS,
  1141. you should not rely on case distinction for file names, and you might
  1142. use the GNU `doschk' program for helping you further diagnosing illegal
  1143. MSDOS names, which are even more limited than System V's.
  1144.  
  1145. 
  1146. File: tar.info,  Node: Symbolic Links,  Next: Old V7 and POSIX,  Prev: Portable Names,  Up: Portability
  1147.  
  1148. Symbolic Links
  1149. --------------
  1150.  
  1151.    Normally, when `tar' archives a symbolic link, it writes a record to
  1152. the archive naming the target of the link.  In that way, the `tar'
  1153. archive is a faithful record of the filesystem contents.
  1154. `--dereference' (`-h') is used with `--create' (`-c'), and causes `tar'
  1155. to archive the files symbolic links point to, instead of the links
  1156. themselves.  When this option is used, when `tar' encounters a symbolic
  1157. link, it will archive the linked-to file, instead of simply recording
  1158. the presence of a symbolic link.
  1159.  
  1160.    The name under which the file is stored in the file system is not
  1161. recorded in the archive.  To record both the symbolic link name and the
  1162. file name in the system, archive the file under both names.  If all
  1163. links were recorded automatically by `tar', an extracted file might be
  1164. linked to a file name that no longer exists in the file system.
  1165.  
  1166.    If a linked-to file is encountered again by `tar' while creating the
  1167. same archive, an entire second copy of it will be stored.  (This
  1168. *might* be considered a bug.)
  1169.  
  1170.    So, for portable archives, do not archive symbolic links as such,
  1171. and use `--dereference' (`-h'): many systems do not support symbolic
  1172. links, and moreover, your distribution might be unusable if it contains
  1173. unresolved symbolic links.
  1174.  
  1175. 
  1176. File: tar.info,  Node: Old V7 and POSIX,  Next: Checksumming Problems,  Prev: Symbolic Links,  Up: Portability
  1177.  
  1178. Old V7 and POSIX Archives
  1179. -------------------------
  1180.  
  1181.    GNU `tar' implements an early draft of the POSIX 1003.1 `ustar'
  1182. standard which is different from the final standard.  Adding support
  1183. for the new changes in a backward-compatible fashion is not trivial.
  1184.  
  1185.    Certain old versions of `tar' cannot handle additional information
  1186. recorded by newer `tar' programs.  To create an archive in V7 format
  1187. (not ANSI), which can be read by these old versions, specify the
  1188. `--old-archive' (`-o') option in conjunction with the `--create'
  1189. (`-c').  `tar' also accepts `--portability' for this option.  When you
  1190. specify it, `tar' leaves out information about directories, pipes,
  1191. fifos, contiguous files, and device files, and specifies file ownership
  1192. by group and user IDs instead of group and user names.
  1193.  
  1194.    When updating an archive, do not use `--old-archive' (`-o') unless
  1195. the archive was created with using this option.
  1196.  
  1197.    In most cases, a *new* format archive can be read by an *old* `tar'
  1198. program without serious trouble, so this option should seldom be
  1199. needed.  On the other hand, most modern `tar's are able to read old
  1200. format archives, so it might be safer for you to always use
  1201. `--old-archive' (`-o') for your distributions.
  1202.  
  1203.