README 9.53 KB
Newer Older
Bdale Garbee's avatar
Bdale Garbee committed
1
2
3
4
5
6
README for GNU tar
See the end of file for copying conditions.

* Introduction

Please glance through *all* sections of this
Bdale Garbee's avatar
Bdale Garbee committed
7
8
'README' file before starting configuration.  Also make sure you read files
'ABOUT-NLS' and 'INSTALL' if you are not familiar with them already.
Bdale Garbee's avatar
Bdale Garbee committed
9

Bdale Garbee's avatar
Bdale Garbee committed
10
11
If you got the 'tar' distribution in 'shar' format, time stamps ought to be
properly restored; do not ignore such complaints at 'unshar' time.
Bdale Garbee's avatar
Bdale Garbee committed
12

Bdale Garbee's avatar
Bdale Garbee committed
13
GNU 'tar' saves many files together into a single tape or disk
Bdale Garbee's avatar
Bdale Garbee committed
14
15
16
archive, and can restore individual files from the archive.  It includes
multivolume support, the ability to archive sparse files, automatic archive
compression/decompression, remote archives and special features that allow
Bdale Garbee's avatar
Bdale Garbee committed
17
18
19
'tar' to be used for incremental and full backups.  This distribution
also includes 'rmt', the remote tape server.  The 'mt' tape drive control
program is in the GNU 'cpio' distribution.
Bdale Garbee's avatar
Bdale Garbee committed
20

Bdale Garbee's avatar
Bdale Garbee committed
21
GNU 'tar' is derived from John Gilmore's public domain 'tar'.
Bdale Garbee's avatar
Bdale Garbee committed
22

Bdale Garbee's avatar
Bdale Garbee committed
23
24
25
26
27
See file 'ABOUT-NLS' for how to customize this program to your language.
See file 'COPYING' for copying conditions.
See file 'INSTALL' for compilation and installation instructions.
See file 'NEWS' for a list of major changes in the current release.
See file 'THANKS' for a list of contributors.
Bdale Garbee's avatar
Bdale Garbee committed
28

Bdale Garbee's avatar
Bdale Garbee committed
29
30
Besides those configure options documented in files 'INSTALL' and
'ABOUT-NLS', an extra option may be accepted after './configure':
Bdale Garbee's avatar
Bdale Garbee committed
31
32
33
34
35
36
37
38
39
40
41

* Install

** Selecting the default archive format.

The default archive format is GNU, this can be overridden by
presetting DEFAULT_ARCHIVE_FORMAT while configuring. The allowed
values are GNU, V7, OLDGNU, USTAR and POSIX.

** Selecting the default archive device

Bdale Garbee's avatar
Bdale Garbee committed
42
43
44
45
46
The default archive device is now 'stdin' on read and 'stdout' on write.
The installer can still override this by presetting 'DEFAULT_ARCHIVE'
in the environment before configuring (the behavior of '-[0-7]' or
'-[0-7]lmh' options in 'tar' are then derived automatically).  Similarly,
'DEFAULT_BLOCKING' can be preset to something else than 20.
Bdale Garbee's avatar
Bdale Garbee committed
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77

** Selecting full pathname of the "rmt" binary.

Previous versions of tar always looked for "rmt" binary in the
directory "/etc/rmt". However, the "rmt" program included
in the distribution was installed under "$prefix/libexec/rmt".
To fix this discrepancy, tar now looks for "$prefix/libexec/rmt".
If you do not want this behavior, specify full path name of
"rmt" binary using DEFAULT_RMT_DIR variable, e.g.:

./configure DEFAULT_RMT_DIR=/etc

If you already have a copy of "rmt" installed and wish to use it
instead of the version supplied with the distribution, use --with-rmt
option:

./configure --with-rmt=/etc/rmt

This will also disable building the included version of rmt.

** Installing backup scripts.

This version of tar is shipped with the shell scripts for producing
incremental backups (dumps) and restoring filesystems from them.
The name of the backup script is "backup". The name of the
restore script is "restore". They are installed in "$prefix/sbin"
directory.

Use option --enable-backup-scripts to compile and install these
scripts.

Bdale Garbee's avatar
Bdale Garbee committed
78
** '--disable-largefile' omits support for large files, even if the
Bdale Garbee's avatar
Bdale Garbee committed
79
80
81
82
83
operating system supports large files.  Typically, large files are
those larger than 2 GB on a 32-bit host.

* Installation hints

Bdale Garbee's avatar
Bdale Garbee committed
84
Here are a few hints which might help installing 'tar' on some systems.
Bdale Garbee's avatar
Bdale Garbee committed
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104

** gzip and bzip2.

GNU tar uses the gzip and bzip2 programs to read and write compressed
archives.  If you don't have these programs already, you need to
install them.  Their sources can be found at:

ftp://ftp.gnu.org/gnu/gzip/
http://sourceware.cygnus.com/bzip2/

If you see the following symptoms:

   $ tar -xzf file.tar.gz
   gzip: stdin: decompression OK, trailing garbage ignored
   tar: Child returned status 2

then you have encountered a gzip incompatibility that should be fixed
in gzip test version 1.3, which as of this writing is available at
<ftp://alpha.gnu.org/gnu/gzip/>.  You can work around the
incompatibility by using a shell command like
Bdale Garbee's avatar
Bdale Garbee committed
105
 'gzip -d <file.tar.gz | tar -xzf -'.
Bdale Garbee's avatar
Bdale Garbee committed
106
107
108
109
110
111
112
113
114
115
116
117
118
119

** Solaris issues.

GNU tar exercises many features that can cause problems with older GCC
versions.  In particular, GCC 2.8.1 (sparc, -O1 or -O2) is known to
miscompile GNU tar.  No compiler-related problems have been reported
when using GCC 2.95.2 or later.

Recent versions of Solaris tar sport a new -E option to generate
extended headers in an undocumented format.  GNU tar does not
understand these headers.

** Static linking.

Bdale Garbee's avatar
Bdale Garbee committed
120
121
Some platform will, by default, prepare a smaller 'tar' executable
which depends on shared libraries.  Since GNU 'tar' may be used for
Bdale Garbee's avatar
Bdale Garbee committed
122
system-level backups and disaster recovery, installers might prefer to
Bdale Garbee's avatar
Bdale Garbee committed
123
force static linking, making a bigger 'tar' executable maybe, but able to
Bdale Garbee's avatar
Bdale Garbee committed
124
125
work standalone, in situations where shared libraries are not available.
The way to achieve static linking varies between systems.  Set LDFLAGS
Bdale Garbee's avatar
Bdale Garbee committed
126
to a value from the table below, before configuration (see 'INSTALL').
Bdale Garbee's avatar
Bdale Garbee committed
127
128
129
130
131
132
133
134
135
136
137
138

	Platform	Compiler	LDFLAGS

	(any)		Gnu C		-static
	AIX		(vendor)	-bnso -bI:/lib/syscalls.exp
	HPUX		(vendor)	-Wl,-a,archive
	IRIX		(vendor)	-non_shared
	OSF		(vendor)	-non_shared
	SCO 3.2v5	(vendor)	-dn
	Solaris		(vendor)	-Bstatic
	SunOS		(vendor)	-Bstatic

Bdale Garbee's avatar
Bdale Garbee committed
139
** Failed tests 'ignfail.sh' or 'incremen.sh'.
Bdale Garbee's avatar
Bdale Garbee committed
140
141
142

In an NFS environment, lack of synchronization between machine clocks
might create difficulties to any tool comparing dates and file time stamps,
Bdale Garbee's avatar
Bdale Garbee committed
143
like 'tar' in incremental dumps.  This has been a recurrent problem with
Bdale Garbee's avatar
Bdale Garbee committed
144
145
146
147
GNU Make for the last few years.  We would like a general solution.

** BSD compatibility matters.

Bdale Garbee's avatar
Bdale Garbee committed
148
149
150
Set LIBS to '-lbsd' before configuration (see 'INSTALL') if the linker
complains about 'bsd_ioctl' (Slackware).  Also set CPPFLAGS to
'-I/usr/include/bsd' if <sgtty.h> is not found (Slackware).
Bdale Garbee's avatar
Bdale Garbee committed
151
152
153
154
155
156
157
158
159
160

** OPENStep 4.2 swap files

Tar cannot read the file /private/vm/swapfile.front (even as root).
This file is not a real file, but some kind of uncompressed view of
the real compressed swap file; there is no reason to back it up, so
the simplest workaround is to avoid tarring this file.

* Special topics

Bdale Garbee's avatar
Bdale Garbee committed
161
Here are a few special matters about GNU 'tar', not related to build
Bdale Garbee's avatar
Bdale Garbee committed
162
163
164
165
matters.  See previous section for such.

** File attributes.

Bdale Garbee's avatar
Bdale Garbee committed
166
About *security*, it is probable that future releases of 'tar' will have
Bdale Garbee's avatar
Bdale Garbee committed
167
some behavior changed.  There are many pending suggestions to choose from.
Bdale Garbee's avatar
Bdale Garbee committed
168
169
170
Today, extracting an archive not being 'root', 'tar' will restore suid/sgid
bits on files but owned by the extracting user.  'root' automatically gets
a lot of special privileges, '-p' might later become required to get them.
Bdale Garbee's avatar
Bdale Garbee committed
171

Bdale Garbee's avatar
Bdale Garbee committed
172
GNU 'tar' does not properly restore symlink attributes.  Various systems
Bdale Garbee's avatar
Bdale Garbee committed
173
174
implement flavors of symbolic links showing different behavior and
properties.  We did not successfully sorted all these out yet.  Currently,
Bdale Garbee's avatar
Bdale Garbee committed
175
the 'lchown' call will be used if available, but that's all.
Bdale Garbee's avatar
Bdale Garbee committed
176
177
178

** POSIX compliance.

Bdale Garbee's avatar
Bdale Garbee committed
179
GNU 'tar' is able to create archive in the following formats:
Bdale Garbee's avatar
Bdale Garbee committed
180
181

  *** The format of UNIX version 7
Bdale Garbee's avatar
Bdale Garbee committed
182
  *** POSIX.1-1988 format, also known as "ustar format"
Bdale Garbee's avatar
Bdale Garbee committed
183
184
185
  *** POSIX.1-2001 format, also known as "pax format"
  *** Old GNU format (described below)

Bdale Garbee's avatar
Bdale Garbee committed
186
187
In addition to those, GNU 'tar' is also able to read archives
produced by 'star' archiver.
Bdale Garbee's avatar
Bdale Garbee committed
188

Bdale Garbee's avatar
Bdale Garbee committed
189
190
A so called 'Old GNU' format is based on an early draft of the
POSIX 1003.1 'ustar' standard which is different from the final
Bdale Garbee's avatar
Bdale Garbee committed
191
192
193
standard. It defines its extensions (such as incremental backups
and handling of the long file names) in a way incompatible with
any existing tar archive format, therefore the use of old GNU
Bdale Garbee's avatar
Bdale Garbee committed
194
format is strongly discouraged.
Bdale Garbee's avatar
Bdale Garbee committed
195
196

Please read the file NEWS for more information about POSIX compliance
Bdale Garbee's avatar
Bdale Garbee committed
197
and new 'tar' features.
Bdale Garbee's avatar
Bdale Garbee committed
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217

* What's next?

GNU tar will be merged into GNU paxutils: a project containing
several utilities related to creating and handling archives in
various formats. The project will include tar, cpio and pax
utilities.

* Bug reporting.

Send bug reports to <bug-tar@gnu.org>.  A bug report should contain
an adequate description of the problem, your input, what you expected,
what you got, and why this is wrong.  Diffs are welcome, but they only
describe a solution, from which the problem might be uneasy to infer.
If needed, submit actual data files with your report.  Small data files
are preferred.  Big files may sometimes be necessary, but do not send them
to the report address; rather take special arrangement with the maintainer.

Your feedback will help us to make a better and more portable package.
Consider documentation errors as bugs, and report them as such.  If you
Bdale Garbee's avatar
Bdale Garbee committed
218
develop anything pertaining to 'tar' or have suggestions, let us know
Bdale Garbee's avatar
Bdale Garbee committed
219
220
221
222
223
and share your findings by writing to <bug-tar@gnu.org>.


* Copying

Janos Lenart's avatar
Janos Lenart committed
224
Copyright 1990-2019 Free Software Foundation, Inc.
Bdale Garbee's avatar
Bdale Garbee committed
225

Bdale Garbee's avatar
Bdale Garbee committed
226
This file is part of GNU tar.
Bdale Garbee's avatar
Bdale Garbee committed
227

Bdale Garbee's avatar
Bdale Garbee committed
228
229
230
231
GNU tar is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Bdale Garbee's avatar
Bdale Garbee committed
232

Bdale Garbee's avatar
Bdale Garbee committed
233
234
235
236
GNU tar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
Bdale Garbee's avatar
Bdale Garbee committed
237

Bdale Garbee's avatar
Bdale Garbee committed
238
239
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
Bdale Garbee's avatar
Bdale Garbee committed
240

Bdale Garbee's avatar
Bdale Garbee committed
241
242
243
244
245
246
NOTE ON COPYRIGHT YEARS

In copyright notices where the copyright holder is the Free Software
Foundation, then where a range of years appears, this is an inclusive
range that applies to every year in the range.  For example: 2005-2008
represents the years 2005, 2006, 2007, and 2008.
Bdale Garbee's avatar
Bdale Garbee committed
247
248
249
250
251
252

Local Variables:
mode: outline
paragraph-separate: "[	]*$"
version-control: never
End: