summaryrefslogtreecommitdiffstats
path: root/docs/man/borg-import-tar.1
blob: 68ffe0d8a6c5d95c384f5024fc833537bd79da25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BORG-IMPORT-TAR" 1 "2022-08-03" "" "borg backup tool"
.SH NAME
borg-import-tar \- Create a backup archive from a tarball
.SH SYNOPSIS
.sp
borg [common options] import\-tar [options] NAME TARFILE
.SH DESCRIPTION
.sp
This command creates a backup archive from a tarball.
.sp
When giving \(aq\-\(aq as path, Borg will read a tar stream from standard input.
.sp
By default (\-\-tar\-filter=auto) Borg will detect whether the file is compressed
based on its file extension and pipe the file through an appropriate filter:
.INDENT 0.0
.IP \(bu 2
\&.tar.gz or .tgz: gzip \-d
.IP \(bu 2
\&.tar.bz2 or .tbz: bzip2 \-d
.IP \(bu 2
\&.tar.xz or .txz: xz \-d
.IP \(bu 2
\&.tar.zstd: zstd \-d
.IP \(bu 2
\&.tar.lz4: lz4 \-d
.UNINDENT
.sp
Alternatively, a \-\-tar\-filter program may be explicitly specified. It should
read compressed data from stdin and output an uncompressed tar stream on
stdout.
.sp
Most documentation of borg create applies. Note that this command does not
support excluding files.
.sp
A \fB\-\-sparse\fP option (as found in borg create) is not supported.
.sp
About tar formats and metadata conservation or loss, please see \fBborg export\-tar\fP\&.
.sp
import\-tar reads these tar formats:
.INDENT 0.0
.IP \(bu 2
BORG: borg specific (PAX\-based)
.IP \(bu 2
PAX: POSIX.1\-2001
.IP \(bu 2
GNU: GNU tar
.IP \(bu 2
POSIX.1\-1988 (ustar)
.IP \(bu 2
UNIX V7 tar
.IP \(bu 2
SunOS tar with extended attributes
.UNINDENT
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
.B NAME
specify the archive name
.TP
.B TARFILE
input tar file. "\-" to read from stdin instead.
.UNINDENT
.SS optional arguments
.INDENT 0.0
.TP
.B  \-\-tar\-filter
filter program to pipe data through
.TP
.B  \-s\fP,\fB  \-\-stats
print statistics for the created archive
.TP
.B  \-\-list
output verbose list of items (files, dirs, ...)
.TP
.BI \-\-filter \ STATUSCHARS
only display items with the given status characters
.TP
.B  \-\-json
output stats as JSON (implies \-\-stats)
.UNINDENT
.SS Archive options
.INDENT 0.0
.TP
.BI \-\-comment \ COMMENT
add a comment text to the archive
.TP
.BI \-\-timestamp \ TIMESTAMP
manually specify the archive creation date/time (UTC, yyyy\-mm\-ddThh:mm:ss format). alternatively, give a reference file/directory.
.TP
.BI \-c \ SECONDS\fR,\fB \ \-\-checkpoint\-interval \ SECONDS
write checkpoint every SECONDS seconds (Default: 1800)
.TP
.BI \-\-chunker\-params \ PARAMS
specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: buzhash,19,23,21,4095
.TP
.BI \-C \ COMPRESSION\fR,\fB \ \-\-compression \ COMPRESSION
select compression algorithm, see the output of the "borg help compression" command for details.
.UNINDENT
.SH EXAMPLES
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# export as uncompressed tar
$ borg export\-tar Monday Monday.tar

# import an uncompressed tar
$ borg import\-tar Monday Monday.tar

# exclude some file types, compress using gzip
$ borg export\-tar Monday Monday.tar.gz \-\-exclude \(aq*.so\(aq

# use higher compression level with gzip
$ borg export\-tar \-\-tar\-filter="gzip \-9" Monday Monday.tar.gz

# copy an archive from repoA to repoB
$ borg \-r repoA export\-tar \-\-tar\-format=BORG archive \- | borg \-r repoB import\-tar archive \-

# export a tar, but instead of storing it on disk, upload it to remote site using curl
$ borg export\-tar Monday \- | curl \-\-data\-binary @\- https://somewhere/to/POST

# remote extraction via "tarpipe"
$ borg export\-tar Monday \- | ssh somewhere "cd extracted; tar x"
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Archives transfer script
.sp
Outputs a script that copies all archives from repo1 to repo2:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
for A T in \(gaborg list \-\-format=\(aq{archive} {time:%Y\-%m\-%dT%H:%M:%S}{LF}\(aq\(ga
do
  echo "borg \-r repo1 export\-tar \-\-tar\-format=BORG $A \- | borg \-r repo2 import\-tar \-\-timestamp=$T $A \-"
done
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Kept:
.INDENT 0.0
.IP \(bu 2
archive name, archive timestamp
.IP \(bu 2
archive contents (all items with metadata and data)
.UNINDENT
.sp
Lost:
.INDENT 0.0
.IP \(bu 2
some archive metadata (like the original commandline, execution time, etc.)
.UNINDENT
.sp
Please note:
.INDENT 0.0
.IP \(bu 2
all data goes over that pipe, again and again for every archive
.IP \(bu 2
the pipe is dumb, there is no data or transfer time reduction there due to deduplication
.IP \(bu 2
maybe add compression
.IP \(bu 2
pipe over ssh for remote transfer
.IP \(bu 2
no special sparse file support
.UNINDENT
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.
.