tar: PAX keywords
1
1 8.3.7.1 Controlling Extended Header Keywords
1 ............................................
1
1 '--pax-option=KEYWORD-LIST'
1 Handle keywords in PAX extended headers. This option is equivalent
1 to '-o' option of the 'pax' utility.
1
1 KEYWORD-LIST is a comma-separated list of keyword options, each
1 keyword option taking one of the following forms:
1
1 'delete=PATTERN'
1 When used with one of archive-creation commands, this option
1 instructs 'tar' to omit from extended header records that it
1 produces any keywords matching the string PATTERN.
1
1 When used in extract or list mode, this option instructs tar to
1 ignore any keywords matching the given PATTERN in the extended
1 header records. In both cases, matching is performed using the
11 pattern matching notation described in POSIX 1003.2, 3.13 (⇒
wildcards). For example:
1
1 --pax-option delete=security.*
1
1 would suppress security-related information.
1
1 'exthdr.name=STRING'
1
1 This keyword allows user control over the name that is written into
1 the ustar header blocks for the extended headers. The name is
1 obtained from STRING after making the following substitutions:
1
1 Meta-character Replaced By
1 ------------------------------------------------------------
1 %d The directory name of the file,
1 equivalent to the result of the
1 'dirname' utility on the translated
1 file name.
1 %f The name of the file with the
1 directory information stripped,
1 equivalent to the result of the
1 'basename' utility on the translated
1 file name.
1 %p The process ID of the 'tar' process.
1 %% A '%' character.
1
1 Any other '%' characters in STRING produce undefined results.
1
1 If no option 'exthdr.name=string' is specified, 'tar' will use the
1 following default value:
1
1 %d/PaxHeaders.%p/%f
1
1 'exthdr.mtime=VALUE'
1
1 This keyword defines the value of the 'mtime' field that is written
1 into the ustar header blocks for the extended headers. By default,
1 the 'mtime' field is set to the modification time of the archive
1 member described by that extended header (or to the value of the
1 '--mtime' option, if supplied).
1
1 'globexthdr.name=STRING'
1 This keyword allows user control over the name that is written into
1 the ustar header blocks for global extended header records. The
1 name is obtained from the contents of STRING, after making the
1 following substitutions:
1
1 Meta-character Replaced By
1 ------------------------------------------------------------
1 %n An integer that represents the
1 sequence number of the global extended
1 header record in the archive, starting
1 at 1.
1 %p The process ID of the 'tar' process.
1 %% A '%' character.
1
1 Any other '%' characters in STRING produce undefined results.
1
1 If no option 'globexthdr.name=string' is specified, 'tar' will use
1 the following default value:
1
1 $TMPDIR/GlobalHead.%p.%n
1
1 where '$TMPDIR' represents the value of the TMPDIR environment
1 variable. If TMPDIR is not set, 'tar' uses '/tmp'.
1
1 'globexthdr.mtime=VALUE'
1
1 This keyword defines the value of the 'mtime' field that is written
1 into the ustar header blocks for the global extended headers. By
1 default, the 'mtime' field is set to the time when 'tar' was
1 invoked.
1
1 'KEYWORD=VALUE'
1 When used with one of archive-creation commands, these
1 keyword/value pairs will be included at the beginning of the
1 archive in a global extended header record. When used with one of
1 archive-reading commands, 'tar' will behave as if it has
1 encountered these keyword/value pairs at the beginning of the
1 archive in a global extended header record.
1
1 'KEYWORD:=VALUE'
1 When used with one of archive-creation commands, these
1 keyword/value pairs will be included as records at the beginning of
1 an extended header for each file. This is effectively equivalent
1 to KEYWORD=VALUE form except that it creates no global extended
1 header records.
1
1 When used with one of archive-reading commands, 'tar' will behave
1 as if these keyword/value pairs were included as records at the end
1 of each extended header; thus, they will override any global or
1 file-specific extended header record keywords of the same names.
1 For example, in the command:
1
1 tar --format=posix --create \
1 --file archive --pax-option gname:=user .
1
1 the group name will be forced to a new value for all files stored
1 in the archive.
1
1 In any of the forms described above, the VALUE may be a string
1 enclosed in curly braces. In that case, the string between the braces
1 is understood either as a textual time representation, as described in
1 ⇒Date input formats, or a name of the existing file, starting
1 with '/' or '.'. In the latter case, the modification time of that file
1 is used.
1
1 For example, to set all modification times to the current date, you
1 use the following option:
1
1 --pax-option='mtime:={now}'
1
1 Note quoting of the option's argument.
1
1 As another example, here is the option that ensures that any two
1 archives created using it, will be binary equivalent if they have the
1 same contents:
1
1 --pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0
1
1 If you extract files from such an archive and recreate the archive from
1 them, you will also need to eliminate changes due to ctime, as shown in
1 examples below:
1
1 --pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0,ctime:=0
1
1 or
1
1 --pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0,delete=ctime
1